P
Phil
Hi,
Media Lint said:Use FileCopy to copy the file to the new location then
Kill to remove it from the old location
If it is on the same drive you can use Name .. As ..
Sub TwoWaysToMove()
' METHOD ONE
FileCopy "h:\l_koch.xls", "h:\test\l_koch.xls"
Kill "h:\l_koch.xls"
' METHOD TWO
Name "h:\test\l_koch.xls" As "h:\l_kock.xls"
End Sub
Edward said:Dirk
Can I use this for All Files, *.* ?
Because I won't know the numerous individual file names contained in a
folder I'm trying to backup.
Thanks
Edward said:Dirk
Using method #2, It actually Cuts & Pastes the files, Not copies.
Scary. Also it doesn't copy folders.
I need to "Copy" all files & folders...
And this seemed so simple when I was assuring someone it would work.
thanks
Edward said:Dirk
Sorry for any misunderstanding of my objective. My original question
to you about copying was under someone else's post, about Moving.
I'm trying to add a Backup utility to an application.
Briefly, to use FileSystemObject and Windows Scripting in Access 97,
how should I get started? Do I need VB 5/6? I can't find much
information on this.
Thanks
Ed
Ken Snell said:Or use late binding in order to avoid having to set a reference:
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFolder "C:\SourceFolder", "C:\BackupFolder"
Set fso = Nothing
Ken Snell said:I don't have ACCESS 97 here to try it, but I believe that
FileScripting is available there.
specific path excluding one file and one folder. When i used the code below,Mani said:Hi,
I have a similar situation. I am trying to copy files and folders from a
"C:\script\export\my_move\" , True-Thanks.
TargetFolder = "C:\script\example\targer_my"
ParentFolder = "C:\script\export\my_move"
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(TargetFolder)
Set objFolder_move = objShell.NameSpace(ParentFolder)
Set colItems = objFolder.Items
For i = 0 to colItems.Count - 1
if colItems.Item(i) <> "default.aspx.vb" Then
Set objFSO = CreateObject("Scripting.FileSystemObject")
name = colItems.Item(i)
objFSO.CopyFile ("C:\script\example\targer_my\" & name & ".*" ),
"C:\script\export\my_move" , True'objFSO.CopyFolder ("C:\script\example\targer_my"),