Jump to content
Sign in to follow this  
sambuddy

@ComSpec doesn't work 4 me

Recommended Posts

sambuddy

Hello all,

I have been trying to run a cmd line program using the following line but it would come up with the error saying it couldnt find the command

$PID=RunWait(@ComSpec & "/C hinfo.exe app.mux > hinfo.txt",$current_directory,@SW_HIDE)

BUT, this line DOES work

$PID=RunWait("cmd.exe /C hinfo.exe app.mux > hinfo.txt", $current_directory,@SW_HIDE )

They do exactly the same thing, can anyone point out anything silly that i am missing?

Thanks

Regards

Edited by sambuddy

Share this post


Link to post
Share on other sites
Danny35d

$PID=RunWait(@ComSpec & " /C hinfo.exe app.mux > hinfo.txt",$current_directory,@SW_HIDE)

You need to leave space between the first quotes and /C.

Edit:

Welcome to AutoIt... ;)

Edited by Danny35d

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites
sambuddy

Hello all,

I have been trying to run a cmd line program using the following line but it would come up with the error saying it couldnt find the command

$PID=RunWait(@ComSpec & "/C hinfo.exe app.mux > hinfo.txt",$current_directory,@SW_HIDE)

BUT, this line DOES work

$PID=RunWait("cmd.exe /C hinfo.exe app.mux > hinfo.txt", $current_directory,@SW_HIDE )

They do exactly the same thing, can anyone point out anything silly that i am missing?

Thanks

Regards

;)

Oh *&%X*%#@$, So near yet so far.

Thanks

That works

Share this post


Link to post
Share on other sites
herewasplato

;)

Oh *&%X*%#@$, So near yet so far.

Thanks

That works

Nah, you just were not spaced out enough.... :-)

Edit: Welcome to the forum....

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
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
Sign in to follow this  

×