Re: permission denied when moving folder
- From: "Paul Randall" <paulr901@xxxxxxxxxxxx>
- Date: Tue, 5 Feb 2008 08:24:12 -0700
For my method, you would have to move them one at a time, using the
full name of each (no wild cards). This does have the advantage of
allowing a rename if you don't want to overwrite a previously backed
up file. If you want to always overwrite, then use Pegasus' method.
-Paul Randall
"Lee Kok Onn" <kolee@xxxxxxxxxxxxxxxx> wrote in message
news:uydLPv9ZIHA.5792@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx
Thanks 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
.
- 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
- From: Lee Kok Onn
- Re: permission denied when moving folder
- Prev by Date: Re: permission denied when moving folder
- Next by Date: wshController CreateScript errors
- Previous by thread: Re: permission denied when moving folder
- Next by thread: WSH and MSN Messenger?
- Index(es):
Relevant Pages
|
Loading