Jump to content
Sign in to follow this  
Bradman

Robocopy Syntax Problem

Recommended Posts

Bradman

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

Share this post


Link to post
Share on other sites
Danny35d

$line = 'xxxx-xxxx-xx\e$'
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', @ScriptDir)


AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites
MHz

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

Share this post


Link to post
Share on other sites
Bradman

Thank you for the fast reply, I will give it a shot at work.

Bradman

Share this post


Link to post
Share on other sites
Bradman

Thank you both. It worked like a champ. Robocopy Rocks! I can finally get some work done!

Share this post


Link to post
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
Sign in to follow this  

×