Recently Browsing 0 members
No registered users viewing this page.
I am trying to pass multi-file selections from Windows Explorer into the $CmdLine argument parameters array. For example, and these are not the literal program/project names, I can pass three full path file names via both Window's Run dialog and Terminal into the $CmdLine array, i.e, "c:\Dir\Program.exe" "D:\Test\file1.txt" "D:\Test\file2.txt" "D:\Test\file3.txt". When checked in the running program, $CmdLine index  has the correct value of 3, index  is correct with "D:\Test\file1.txt", index  with "D:\Test\file2.txt" and index  with "D:\Test\file3.txt". I get the same correct results in $CmdLine array when I start Program.exe with the same three file parameters using the Windows Terminal.
Also, I have added a HKEY_CLASSES_ROOT\*\shell\command key to the Window's registry. The registry entry is with a "C:\Program.exe" "%1" "$2" "%3" string value to allow for renaming file(s) from Windows Explorer via the right-click menu. With just one parameter placeholder, "%1" in the string value, a selected file will appear in $CmdLine. $CmdLine is 1 and $Cmdline contains the selected full path file name. Unfortunately, when I change the registry string value to include two more passing arguments, "%2" "%3", $CmdLine =3 (as it should since three file path names are passed to Program.exe), $CmdLine contains "D:\Test\file1.txt", but $CmdLine and  are just empty strings.
It appears to me that Windows is not passing the second and third ("%2" and "%3") selected file's to Autoit, but just the first parameter "%1".
Is there some way that I can select more than one file in Window's Explorer and pass the full file paths into the $CmdLine array?
I know that AutoIt has the _WinAPI_GetOpenFileName function, but I would like to select files directly from Windows Explorer to bring into $CmdLine.
File Renaming Application 188.8.131.52.au3 Reg Key.reg
I have to run an executable with a parameter preceded by a /, like this:
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?
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:
 = Full URL (same as $sURL)  = Protocol (i.e.: http, https, ftp, ws...)  = Domain  = Port (or null if not specified)  = Path (or null if not specified)  = Query string (everything after the ? - or null if not specified) Example:
$aExample = ParseURL("https://google.com:8080/?name=doe") MsgBox(0, "Test", "URL: " & $aExample & @CRLF & _ "Protocol: " & $aExample & @CRLF & _ "Domain: " & $aExample & @CRLF & _ "Port: " & $aExample & @CRLF & _ "Path: " & $aExample & @CRLF & _ "Query string: " & $aExample)
ParseStr( $sStr )
Parses a query string (similar to the  of the previous function) and returns a multidimensional array, where:
 = number of variables found  = ununsed  = key name of the first variable  = first variable value (already URL decoded) [n] = key name of the nth variable [n] = 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:  = 2  = ununsed  = foo  = bar  = test  = lol 123 #ce Feel free to fork!
#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], "(\S+)", $STR_REGEXPARRAYGLOBALMATCH) For $j = 0 To UBound($aSplit)-1 $aUsers[$i][$j] =$aSplit[$j] Next $aUsers[$i]=StringReplace($aUsers[$i],'>','') Next $sUser=$iBenutzername Func _FindUserID($aArray,$sSearch) Local $iRow=_ArraySearch($aArray,$sUser) If @error Then Return SetError(@error,-1,'') Local $sID=$aArray[$iRow] Return SetError(0,$iRow,$sID) EndFunc MsgBox(64,'Searcher UserID '&$sUser,_FindUserID($aUsers,$sUser))
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