Jump to content

Automating command line and "


Recommended Posts

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

 

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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