16 posts in this topic
I've written the code below which launches chrome in incognito mode and then proceeds to go to the autoit website.
From my understanding, the Run() command is also supposed to output the PID number related to the application that got launched from the Run command.
However when I run the below lines, it outputs a PID number that is different from the newly launched chrome browser's PID number, does anyone know why and possibly explain how I could retrieve the accurate PID number associated with the newly launched browser?
Global $iPid = Run(@ComSpec & ' /c start chrome.exe https://www.autoitscript.com/forum/ -incognito' ,"", "") msgbox(0,"",$iPid) Thank you,
I compiled a script I made that takes a command line parameter (the version of a .msi installer) when launched. The script was compiled with the /console option. The script (.au3) works fine but the executable returns the following error:
Error: array variable has incorrect number of subscripts or subscript dimension range exceeded
I need to start a script that include:
- admin privileges
- multiple cmd commands
- no bat, no exe, no tmp files created anywhere (especially in the user temp folder)
In a bat file it would be simple, but users shouldn't see what commands I'm sending.
Example of the script:
echo off cls echo. echo I AM A TOOL echo. echo NOTE: echo - note 1 echo - note 2 echo - etc set USER1=0 set COMPUTER1=0 if /i %username% equ user.user ( set USER1=1 set COMPUTER1=1 ) if /i %username% equ another.user set USER1=1 if /i %computername% equ notebook set COMPUTER1=1 if %USER1% EQU 1 ( if %COMPUTER1% EQU 1 ( reg delete "HKLM\SOFTWARE\blablabla" /f ) else ( echo Computer not authorized. Contact assistance.) ) else ( echo User not authorized. Contact assistance.) echo. pause exit With the send("") is a disaster.
I'm a noob here, so what can I do?
EDIT: OR ELSE I explain the situation and what I need, so if there is a simple solution I can use that.
SITUATION: our domain users have Users rights on the machine. Some of them need administrator rights.
We create a local user with administrator rights, so that the users must insert username and password when asked to run something with administrator rights.
We have an internal domain group policy that blocks EXE, BAT, COM, TMP files from the user local temp directory, for a security reason (malware). That also blocks most software installation.
But some users are often out of office, away from workplace and in another country, they need a complete control on their computers.
WHAT I NEED: I need to check the username and the computer name. If the username is the one with local administrator rights and the computer name is a computer that is qualified to temporary remove the policy, then I need to execute a REG DELETE command with administrator rights.
I hope I explained myself.
Thank you very much.
If I run "stripcat scandataF.dta" (or scandataF.bat which has same script) from command line it works without error but if I run from AutoIt script it fails
I have tried
; > not work $DOS = RunWait(@ComSpec & ' /c "stripcat.exe "scandataF.dta' & @CRLF, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) ; $DOS = RunWait(@ComSpec & " /k " & "scandataF.bat" & @CRLF, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) ; Run("scandataF.bat") The "not work" line doesn't throw any error but also doesn't function. Both Run & RunWait do throw the Micro$oft error.
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!