Jump to content
Sign in to follow this  
gcue

@Comspec /c vs. RunDos

Recommended Posts

gcue

what is the difference between @ComSpec /c and RunDos?

in our environment, several pcs can run ComSpec dos commands just fine while others cannot.

i am going to try to run rundos, hopefully this will work on all pcs =)

i will let you know

Share this post


Link to post
Share on other sites
KaFu

Func _RunDOS($sCommand)
    Local $nResult = RunWait(@ComSpec & " /C " & $sCommand, "", @SW_HIDE)
    Return SetError(@error, @extended, $nResult)
EndFunc   ;==>_RunDOS

RunWait? No real 'difference', as RunDOS utilizes @ComSpec /c...

Edited by KaFu

Share this post


Link to post
Share on other sites
ResNullius

in our environment, several pcs can run ComSpec dos commands just fine while others cannot.

When you say "while others cannot", what happens exactly?

Does a command prompt open and then just disappear without executing the expected command?

Also, are you familiar with the "@Comspec & "/k" switch?

It prevents the command prompt from closing after execution, and is useful for seeing any error messages output by the command.

Share this post


Link to post
Share on other sites
gcue

ahhh good to know.. didnt know about the /k

turns out reason it wasnt working some pcs was path had spaces.. tooootally unrelated.

good to know kafu that they are one in the same

thanks fellas!

When you say "while others cannot", what happens exactly?

Does a command prompt open and then just disappear without executing the expected command?

Also, are you familiar with the "@Comspec & "/k" switch?

It prevents the command prompt from closing after execution, and is useful for seeing any error messages output by the command.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.