Stuempi Posted April 1, 2009 Posted April 1, 2009 Hi there, I'm pretty new to all this, so please don't hit me if this question is too simple I want to run xcopy via autoit and the variable has to be a part of the path from which to copy the files from... RunWait("xcopy C:\test\all\all " & $Variable1 & $Variable2 & "/e /y /r") RunWait("xcopy 'C:\test\' & $Variable3 & '\' & $Variable4 & " & $Variable1 & $Variable2 & "/e /y /r") The first code is working so I don't think that anything is amiss with the variables... but I'm a bit clueless how to put the variables into the path of the source... Variable 1 is something like C:\test2\ Variable 2 is something like ZZZZZ Variable 3 is something like 01 Variable 4 is something like 1 for example: xcopy C:\test\01\1 C:\test2\ZZZZZ /e /y /r Hope you get me... and can help me
Developers Jos Posted April 1, 2009 Developers Posted April 1, 2009 First example is missing a space before /e RunWait("xcopy C:\test\all\all " & $Variable1 & $Variable2 & " /e /y /r") Seconds one something like: RunWait('xcopy "C:\test\' & $Variable3 & '\' & $Variable4 & '" "' & $Variable1 & $Variable2 & '"/e /y /r') Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Stuempi Posted April 1, 2009 Author Posted April 1, 2009 gnaaaa... I nearly got it myself! Thank you very much, saved my day
Stuempi Posted April 6, 2009 Author Posted April 6, 2009 Hey... I got the same kind of problem again... is there any tutorial on how to " and ' those variables?! I didn't find anything useful So again I want to do some xcopy on paths which are variable... this time a bit diffrent: RunWait('xcopy "C:\test\' & $file & '.exe' & '" "' & $Pfad & $pfadu & '" "' & '/e /y /r"') $pfad is something like "C:\test2\" and $pfadu is something like "test\test\" I would be very grateful if someone could help me on this :/
Moderators SmOke_N Posted April 6, 2009 Moderators Posted April 6, 2009 Hey... I got the same kind of problem again... is there any tutorial on how to " and ' those variables?! I didn't find anything useful So again I want to do some xcopy on paths which are variable... this time a bit diffrent: RunWait('xcopy "C:\test\' & $file & '.exe' & '" "' & $Pfad & $pfadu & '" "' & '/e /y /r"') $pfad is something like "C:\test2\" and $pfadu is something like "test\test\" I would be very grateful if someone could help me on this :/You could use double-double quotes if it makes it easier. No idea what the vars are, so you may need a space between the two $P+ vars:RunWait("xcopy """ & @HomeDrive & "\test\" & $file & ".exe"" " & $Pfad & $pfadu & " /e /y /r") Easiest way to see if you've done it correctly is to view it first:MsgBox(64, "View Quotes", "xcopy """ & @HomeDrive & "\test\" & $file & ".exe"" " & $Pfad & $pfadu & " /e /y /r")After practicing with singlequotes/double/and double-single/double quotes, you'll become a quote Jedi Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Stuempi Posted April 6, 2009 Author Posted April 6, 2009 Hey Smoke, thanks for another fast answer ... but that didn't work for me. I tried some more with a collegue and the following line worked for me: RunWait('xcopy "C:\test' & $file & '.exe"' & ' "' & $Pfad & $pfadu & '" ' & '/e /y /r') But I think the msgbox tip might come in handy Thank you for this!
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