Jump to content

vbscript error


amit
 Share

Recommended Posts

Hi,

I was writing a script to copy a file to other location. But it is giving me error when I am giving it path for example "&WinDir%\system32\". If I give it exact path like "c:\winnt\system32", it is doing well.

Please take a look at it if there is any error in it.

Const OverwriteExisting = TRUE

Set objFSO1 = CreateObject("Scripting.FileSystemObject")

objFSO1.CopyFile "example.txt" , "%WinDir%\System32\", OverwriteExisting

Set objFSO2 = CreateObject("Scripting.FileSystemObject")

objFSO2.CopyFile "example2.txt" , "%WinDir%\System32\", OverwriteExisting

Thanx in Advance.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy