Re: permission denied when moving folder




"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


.



Relevant Pages

  • Re: permission denied when moving folder
    ... If you want to always overwrite, ... -Paul Randall ... so how can I check for file existence with the line recommend by ... So its there anyway that I can overwrite the file using movefile. ...
    (microsoft.public.scripting.wsh)
  • Re: Overwriting an existing Excel workbook
    ... *always* got an overwrite prompt from VBA with the test code that I ... Dave Peterson schreef: ... And the Conflictresolution setting has to do with shared workbooks. ...
    (microsoft.public.excel.misc)
  • Re: excel object
    ... Thanks for the reply but which one do I use to overwrite an existing file ... without a prompt. ... This script will be scheduled. ... In order to crete an excel object do I have to have excel ...
    (microsoft.public.scripting.vbscript)
  • Re: SaveFileDialog.ShowDialog() returns Cancel when Yes to overwri
    ... I am using the SaveFileDialog out of a *.exe that does not have a GUI ... The workaround I found is to just disable the overwrite prompt ... a bug in your own code that makes the return value looks bad when it is ...
    (microsoft.public.dotnet.languages.vb)
  • Re: SaveAs with Prompt (no overwrite w/o prompt!!)
    ... suggested using the fs object (fileSystem Object) which will work fine. ... Another option is to use the FileSearch from within Word. ... > According to Help, if you use SaveAs, you don't get a prompt to overwrite. ...
    (microsoft.public.word.vba.customization)

Loading