Jump to content

robocopy help


 Share

Recommended Posts

an anyone tell me what's wrong with this line..

RunWait('robocopy "' & @HomeDrive & '\Drivers"' & '\Test"' & ' "' & $var1 & ":\" & "\EUB\" & $var2 & " backup" & '\Desktop" /S /E /R:0 /W:0', "", @SW_SHOWNORMAL)

when I run it it doesn't copy anything.

Link to comment
Share on other sites

Can anyone tell me what's wrong with this line..

RunWait('robocopy "' & @HomeDrive & '\Drivers"' & '\Test"' & ' "' & $var1 & ":\" & "\EUB\" & $var2 & " backup" & '\Desktop" /S /E /R:0 /W:0', "", @SW_SHOWNORMAL)

when I run it it doesn't copy anything.

I found it \Drivers" (Deleted quote)

RunWait('robocopy "' & @HomeDrive & '\Drivers' & '\Test"' & ' "' & $var1 & ":\" & "\EUB\" & $var2 & " backup" & '\Desktop" /S /E /R:0 /W:0', "", @SW_SHOWNORMAL)

Edited by guayo
Link to comment
Share on other sites

an anyone tell me what's wrong with this line..

RunWait('robocopy "' & @HomeDrive & '\Drivers"' & '\Test"' & ' "' & $var1 & ":\" & "\EUB\" & $var2 & " backup" & '\Desktop" /S /E /R:0 /W:0', "", @SW_SHOWNORMAL)

when I run it it doesn't copy anything.

I'm a newbie around here, so I'm not sure, are you getting the right single/double quotes? It seems you are trying to preserve double quotes around the generated source/destination paths for the command line. I'm not on a windows box at the moment so I can't try it, but if you run the following, does the command line come up as desired?

$var1 = "FileOne.tmp" ; set however it comes in your script
$var2 = "FileTwo.tmp"

$CmdLine = 'robocopy "' & @HomeDrive & '\Drivers"' & '\Test"' & ' "' & $var1 & ":\" & "\EUB\" & $var2 & " backup" & '\Desktop" /S /E /R:0 /W:0'

MsgBox(0,"Is this the right command line?", $CmdLine)

All those single/double quote combos are making my head hurt, but with the above script you could tweak it till it comes out right. Of course, you could also do the same thing in your script by commenting out your RunWait() line and replacing it with the following until you had the string formatted right:

; Temporarily commented out
; RunWait('robocopy "' & @HomeDrive & '\Drivers"' & '\Test"' & ' "' & $var1 & ":\" & "\EUB\" & $var2 & " backup" & '\Desktop" /S /E /R:0 /W:0', "", @SW_SHOWNORMAL)
;

MsgBox(0, "Is this right?", 'robocopy "' & @HomeDrive & '\Drivers"' & '\Test"' & ' "' & $var1 & ":\" & "\EUB\" & $var2 & " backup" & '\Desktop" /S /E /R:0 /W:0', "")

Same effect, you get to see if the string is parsing as expected.

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

I found it \Drivers" (Deleted quote)

RunWait('robocopy "' & @HomeDrive & '\Drivers' & '\Test"' & ' "' & $var1 & ":\" & "\EUB\" & $var2 & " backup" & '\Desktop" /S /E /R:0 /W:0', "", @SW_SHOWNORMAL)

Try this line:

RunWait('RoboCopy "' & @HomeDrive & '\Drivers\Test" "' & $var1 & ':\EUB' & $var2 & 'backup\Desktop" /S /E /R:0 /W:0', '', @SW_SHOWNORMAL)

when I run it it doesn't copy anything.

Becarefull testing your script in you own computer. I did a script using robocopy and I was under impresion that it didn't copy but found out the hard way that when you have a wrong syntax type on Robocopy actually copy everything into %WinDir%\System32 folder.
AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Link to comment
Share on other sites

I found it \Drivers" (Deleted quote)

RunWait('robocopy "' & @HomeDrive & '\Drivers' & '\Test"' & ' "' & $var1 & ":\" & "\EUB\" & $var2 & " backup" & '\Desktop" /S /E /R:0 /W:0', "", @SW_SHOWNORMAL)

Try this line:

RunWait('RoboCopy "' & @HomeDrive & '\Drivers\Test" "' & $var1 & ':\EUB' & $var2 & 'backup\Desktop" /S /E /R:0 /W:0', '', @SW_SHOWNORMAL)

Becarefull testing your script in you own computer. I did a script using robocopy and I was under impresion that it didn't copy but found out the hard way that when you have a wrong syntax type on Robocopy actually copy everything into %WinDir%\System32 folder.

I had that happend to me twice, I made an image of my pc just in case.
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...