$CmdLine parameters
-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By lonardd
Hi
I have to run an executable with a parameter preceded by a /, like this:
c:\myfolder\Tools\AutomaticRun\myexe.EXE /filename=c:\myfolder\Tools\AutomaticRun\myTemplate.xml")
I tried both this:
$iReturn = RunWait ("c:\myfolder\Tools\AutomaticRun\myexe.EXE"," /filename=c:\myfolder\Tools\AutomaticRun\myTemplate.xml")
and using COMSPEC as per some posted suggestions on this forum:
Run(@comspec & ' /c "c:\myfolder\Tools\AutomaticRun\myexe.EXE" /filename=c:\myfolder\Tools\AutomaticRun\myTemplate.xml')
They both seem to fail.
Can you please tell me what I'm doing wrong?
Thanks
Dave
-
By Skysnake
Hi
Problem is this
myscript -p <zumerkelen> -x something else myscript is my AutoIt compiled CUI.
-p <> is first param - fails, see below
-x [text] second param, works.
When I run this with the param enclosed in <> I get the response
The syntax of the command is incorrect.
Experimentation indicates that the <> tags are the problem.
_ArrayDisplay($CmdLine, "1 Array") MsgBox(16, "1 Raw", $CmdLineRaw) The problem is with the reading of the command line. It fails BEFORE it gets into the variables...
I am not dealing with AutoIt, or even my own command line, this is legacy software. It seems that AutoIt "interprets" the <> before loading the command line... I need to be able to read that as text without it being interpreted.
The only part I can control is my script, the myscript, which I can change at will.
The standard command line functions appear all to interpret params on read. I want those params read raw. If I could just get that as a string it would be fine.
Where to look?
Skysnake
-
By Jefrey
I've ported these two functions from PHP to AU3 to work with URLs.
Made them for those who work with libraries like HTTP.au3 (not the one I coded), that needs passing the server domain, path, etc., instead of the full URL.
Grab the lib here.
ParseURL( $sURL )
Parses the URL and splits it into defined parts. Returns an array:
[0] = Full URL (same as $sURL) [1] = Protocol (i.e.: http, https, ftp, ws...) [2] = Domain [3] = Port (or null if not specified) [4] = Path (or null if not specified) [5] = Query string (everything after the ? - or null if not specified) Example:
$aExample = ParseURL("https://google.com:8080/?name=doe") MsgBox(0, "Test", "URL: " & $aExample[0] & @CRLF & _ "Protocol: " & $aExample[1] & @CRLF & _ "Domain: " & $aExample[2] & @CRLF & _ "Port: " & $aExample[3] & @CRLF & _ "Path: " & $aExample[4] & @CRLF & _ "Query string: " & $aExample[5])
ParseStr( $sStr )
Parses a query string (similar to the [5] of the previous function) and returns a multidimensional array, where:
[0][0] = number of variables found [0][1] = ununsed [1][0] = key name of the first variable [1][1] = first variable value (already URL decoded) [n][0] = key name of the nth variable [n][1] = nth variable value (already URL decoded) Example:
include <Array.au3> ; need only to do _ArrayDisplay, not needed by the lib _ArrayDisplay(ParseStr("foo=bar&test=lol%20123")) #cs Result is: [0][0] = 2 [0][1] = ununsed [1][0] = foo [1][1] = bar [2][0] = test [2][1] = lol 123 #ce Feel free to fork!
-
By Eddi96
Hello guys!
#include <Array.au3> #include <File.au3> $iBenutzername = $Var_cmdline ; I need this to be the variable given as a parameter. ; I've read alot about CmdLine but can't think of a way to define a variable with it ; I hope you have an Idea on how to do it! Much love <3 Global $sFile = "C:\GTScript\query.txt" Global $aUsers _FileReadToArray($sFile, $aUsers, $FRTA_NOCOUNT) _ArrayColInsert($aUsers, 1) _ArrayColInsert($aUsers, 1) _ArrayColInsert($aUsers, 1) _ArrayColInsert($aUsers, 1) _ArrayColInsert($aUsers, 1) _ArrayColInsert($aUsers, 1) For $i = 0 To UBound($aUsers) - 1 $aSplit = StringRegExp($aUsers[$i][0], "(\S+)", $STR_REGEXPARRAYGLOBALMATCH) For $j = 0 To UBound($aSplit)-1 $aUsers[$i][$j] =$aSplit[$j] Next $aUsers[$i][0]=StringReplace($aUsers[$i][0],'>','') Next $sUser=$iBenutzername Func _FindUserID($aArray,$sSearch) Local $iRow=_ArraySearch($aArray,$sUser) If @error Then Return SetError(@error,-1,'') Local $sID=$aArray[$iRow][2] Return SetError(0,$iRow,$sID) EndFunc MsgBox(64,'Searcher UserID '&$sUser,_FindUserID($aUsers,$sUser))
-
By Skysnake
Hi Everyone
I want to have a GUI, but which will accept command line options on launch.
So, the commanline would look something like
myAPP.EXE -bigfont -bigicon
where myAPP.EXE would be the name of the AutoIt EXE, and the -bigfont & -bigicon items represent optional command line parameters with which the EXE starts.
I am not looking at creating a CUI. This is GUI, but with startup command line parameters. These command line parameters would only be read once, during start up of the EXE.
I have searched the forum, no luck. What I did find was this commented by Water: https://www.autoitscript.com/forum/topic/138754-adding-command-line-parameter/
Should I start the GUI EXE as normal, and then first possible opportunity read the command line? Is that the way to go?
Thanks in advance
-
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now