Jump to content

Copying folder by xcopy


 Share

Recommended Posts

Hi guys,

I am trying to copy a folder(with loads of stuff related to java) from one harddisk to another one. But things goes wrong even with this simple script. This is the main part:

RunWait(@ComSpec & ' /c Xcopy /S/I/E/Y/T ' & $deploymentFolder_2008 & " " & $AppDataLocalLow)

The targeted folder is quite large (100-200MB). The script will run automatically every time when the someone has logged on. It turns out that it only create a empty folder and copy one file for me.

However, at the moment I test it, it has no issue at all. I wonder what make it goes wrong. Admin right? File size? Or something else?

I have try to do the same thing with dircopy/filecopy, but it gives the same behavior.

DirCopy($deploymentFolder_2008, $AppDataLocalLow,1)
Link to comment
Share on other sites

Try to add double quotes for the source and destination :

RunWait(@ComSpec & ' /c Xcopy /S/I/E/Y/T "' & $deploymentFolder_2008 & '" "' & $AppDataLocalLow & '"')

Is there an error with xcopy ? what is the resut of the command (with /k instead of /c) ?

Link to comment
Share on other sites

When I use dircopy, it does has return an error code. 

But for xcopy, no error message at all. When I run the script with your change, still nothing change.

The script give a clean cmd window pop out, without any running code on it

Now not the clean thing, the cmd windows shows File not found - Common

Edited by tonysing
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...