Jump to content

Robocopy Syntax Problem


Recommended Posts

I have a problem with the syntax using Robocopy.

RunWait("robocopy C:\TOOLBOX_FILES$ \\"& $line &"\TOOLBOX_FILES$ /MIR /COPYALL /V /ZB /R:10 /W:30")

This command works, I am reading systems names from a text file.

When I add the log file function and some more switches, I start having problems.

RunWait("robocopy C:\TOOLBOX_FILES$ \\"& $line &"\TOOLBOX_FILES$ /MIR /COPYALL /V /TS /FP /NP /LOG+:"& @ScriptDir &"\ROBOCOPY_LOG.txt /ZB /IPG:100 /R:10 /W:30 /ETA")

This above line does not generate the log file and errors out.

RunWait('robocopy "C:\TOOLBOX_FILES$" "\\xxxx-xxxx-xx\e$\TOOLBOX_FILES$" /MIR /COPYALL /V /TS /FP /NP /LOG+:"C:\ROBOCOPY_LOG.txt" /ZB /IPG:100 /R:10 /W:30 /ETA')

The above line works fine on it's own but when I add the variables I start having problems.

Can someone point me in the right direction and let me know where the syntax error is?

Thanks,

Bradman

Link to comment
Share on other sites

RunWait('robocopy "C:\TOOLBOX_FILES$" "\\xxxx-xxxx-xx\e$\TOOLBOX_FILES$" /MIR /COPYALL /V /TS /FP /NP /LOG+:"C:\ROBOCOPY_LOG.txt" /ZB /IPG:100 /R:10 /W:30 /ETA')

The above line works fine on it's own but when I add the variables I start having problems.

Can someone point me in the right direction and let me know where the syntax error is?

Thanks,

Bradman

Only one variable that I see.

RunWait('robocopy "C:\TOOLBOX_FILES$" "\\' & $line & '\TOOLBOX_FILES$" /MIR /COPYALL /V /TS /FP /NP /LOG+:"C:\ROBOCOPY_LOG.txt" /ZB /IPG:100 /R:10 /W:30 /ETA')

Give that a try. :)

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...