SpuddyMcSpud Posted February 25, 2008 Posted February 25, 2008 Hi all, I've been trying to get this going for hours now with no luck. I'm sure it's a case of a badly-placed ' or " but damned if I can figure out where. Below is the relevant code (I know I could run this all from one line, but the code is split out into multiple functions for a bunch of reasons and it works fine in plenty of other places.): $Command="robocopy \\Server\Share$\ /S /PURGE /R:0 C:\Destination /XF *.au3" $CMDToRun="RunWait(@ComSpec&' /k "&$Command&"','C:\Windows', @SW_SHOW)" Run(@AutoItExe&" /AutoIt3ExecuteLine "&$CMDToRun) If I console.write $CMDToRun and then paste it into a test.au3, it works fine. If I run it using /AutoIt3ExecuteLine, I get: Line 1: RunWait(@ComSpec&' RunWait(@ComSpec&'^ ERROR Error: String missing closing quote. But I've tried every way I could think of to get the quotes right without any luck. Any help appreciated!
Bert Posted February 26, 2008 Posted February 26, 2008 (edited) $Command="robocopy \\Server\Share$\ /S /PURGE /R:0 C:\Destination /XF *.au3" $CMDToRun= RunWait(@ComSpec&' /k '&$Command, "C:\Windows") @sw_show is not supported in RunWait (According to the helpfile) Edited February 26, 2008 by Volly The Vollatran project My blog: http://www.vollysinterestingshit.com/
SpuddyMcSpud Posted February 26, 2008 Author Posted February 26, 2008 Thanks for replying Volly. Still no luck - same error as before.
SpuddyMcSpud Posted February 26, 2008 Author Posted February 26, 2008 I'm still completely stumped by this one, been trying to work it out all day - anyone able to shed any light at all??
MHz Posted February 26, 2008 Posted February 26, 2008 I may have a working version to use. The echo seems to work fine. ;~ $Command = "robocopy \\Server\Share$\ /S /PURGE /R:0 C:\Destination /XF *.au3" $Command = 'echo testing...' $CMDToRun = "RunWait(@ComSpec&' /k " & $Command & "',@WindowsDir,@SW_SHOW)" Run('"' & @AutoItExe & '" /AutoIt3ExecuteLine "' & $CMDToRun & '"')
SpuddyMcSpud Posted February 26, 2008 Author Posted February 26, 2008 I may have a working version to use. The echo seems to work fine. ;~ $Command = "robocopy \\Server\Share$\ /S /PURGE /R:0 C:\Destination /XF *.au3" $Command = 'echo testing...' $CMDToRun = "RunWait(@ComSpec&' /k " & $Command & "',@WindowsDir,@SW_SHOW)" Run('"' & @AutoItExe & '" /AutoIt3ExecuteLine "' & $CMDToRun & '"') Ah geez it was the Run /AutoIt3ExecuteLine line causing the problem, not the line I was sending to run. Thanks a lot MHz, really appreciate the help. cheers, Spud
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now