Jump to content

running command copy with @scriptdir


Go to solution Solved by Gianni,

Recommended Posts

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

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