Jewtus Posted April 28, 2014 Share Posted April 28, 2014 I'm trying to execute a copy statement from in my script (basically I'm using it to concatenate all the text files in a folder) When I give the explicit path it works, but when I try to use @scriptdir it doesn't RunWait('"' & @ComSpec & '" /c copy C:\Automation\AutoIt\db\log\*.txt C:\Automation\AutoIt\db\log\outfile.csv', '', @SW_HIDE) When I try to use RunWait('"' & @ComSpec & '" /c copy '&@ScriptDir"\db\log\*.txt "&@ScriptDir"\db\log\merged.csv"&', '', @SW_HIDE) it errors. I've been trying to figure out a simple way of doing this and I even tried this: $CMDLINE[copy @ScriptDir&"\db\log\*.txt" @ScriptDir&"\db\log\output.csv"] but I seem to be missing something. Any suggestions? Link to comment Share on other sites More sharing options...
Solution Gianni Posted April 28, 2014 Solution Share Posted April 28, 2014 some ampersand "&" are missing and some " exceed try this: RunWait(@ComSpec & ' /c copy ' & @ScriptDir & '\db\log\*.txt ' & @ScriptDir & '\db\log\merged.csv', '', @SW_HIDE) Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Jewtus Posted April 28, 2014 Author Share Posted April 28, 2014 Perfect. Thanks Link to comment Share on other sites More sharing options...
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