Re: permission denied when moving folder
- From: "Lee Kok Onn" <kolee@xxxxxxxxxxxxxxxx>
- Date: Tue, 5 Feb 2008 17:46:20 +0800
i am using the following to delete file,
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFile "C:\data\*.*" , "\\server2\backup"
so how can I check for file existence with the line recommend by you.
"Paul Randall" <paulr901@xxxxxxxxxxxx> wrote in message news:%23JLazlzZIHA.4028@xxxxxxxxxxxxxxxxxxxxxxx
"Lee Kok Onn" <kolee@xxxxxxxxxxxxxxxx> wrote in message news:O1UEvPxZIHA.4028@xxxxxxxxxxxxxxxxxxxxxxxThanks for the info.
I try to use movefile in the script and I need to overwrite the same file everyday. But it prompt an error "file already exist". So its there anyway that I can overwrite the file using movefile.
Why not, just before the move, check for the existence of the file at the destination, and deleting it if necessary?
Something like:
If objFSO.FileExists(sDestinationPath) Then
objFSO.DeleteFile ( sDestinationPath[, force] )
End If
-Paul Randall
.
- Follow-Ups:
- Re: permission denied when moving folder
- From: Paul Randall
- Re: permission denied when moving folder
- From: Pegasus \(MVP\)
- Re: permission denied when moving folder
- References:
- Re: permission denied when moving folder
- From: Lee Kok Onn
- Re: permission denied when moving folder
- From: Paul Randall
- Re: permission denied when moving folder
- Prev by Date: Re: To drag a file as parameter to script
- Next by Date: Re: permission denied when moving folder
- Previous by thread: Re: permission denied when moving folder
- Next by thread: Re: permission denied when moving folder
- Index(es):
Loading