Jump to content
Sign in to follow this  
Terenz

Automating command line and "

Recommended Posts

Terenz

I need to automate a commandline. Pratically the "original" one do something like:

soft.exe --myparam -y "X:\Path\File" anotherparam

And my compiled take the same:

myexe.exe --myparam -y "X:\Path\File" anotherparam

But with a difference to do other things ( like cleanup, file removing etc ) unlike of the original one. The script for the command line part is:

Global $sParam
If $CmdLine[0] >= 1 Then ; command line
    For $x = 1 To $CmdLine[0]
        $sParam &= $CmdLine[$x] & " "
    Next
EndIf
$sParam = StringTrimRight($sParam, 1) ; remove last space
MsgBox(0,0,$sParam)

Run(@ScriptDir & "\soft.exe " & $sParam)

The problem is the " the $CmdLine just remove it, don't care if i'll make double "" in the final string is always:

--myparam -y X:\Path\File anotherparam

First, why? And in second place what i need to do for passing exactly the same string like i have write in CMD?

Thanks


Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Share this post


Link to post
Share on other sites
Jos

First, why? And in second place what i need to do for passing exactly the same string like i have write in CMD?

​That is how it works with batchfiles as well, but look at $CmdLineRaw for the whole original commandline and strip the beginning.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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  

×