BlazerV60 Posted October 20, 2017 Posted October 20, 2017 Hello all, 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, Brian
jguinch Posted October 20, 2017 Posted October 20, 2017 it returns the pid if cmd.exe (@ComSpec). Run directly chrome.exe, without using @ComSpec & /c Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
BlazerV60 Posted October 20, 2017 Author Posted October 20, 2017 Thanks for the reply, but if I run chrome.exe directly, how would I be able to add Command Prompt attributes such as -incognito? There are a few other command prompt attributes I want to add besides that as well.
jguinch Posted October 20, 2017 Posted October 20, 2017 Well, just like that : Global $iPid = Run('chrome.exe https://www.autoitscript.com/forum/ -incognito') msgbox(0,"",$iPid) Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
AdamUL Posted October 20, 2017 Posted October 20, 2017 Use the full path to the EXE. Global $iPid = Run('"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" https://www.autoitscript.com/forum/ -incognito' ,"", "") msgbox(0,"",$iPid) Adam
BlazerV60 Posted October 21, 2017 Author Posted October 21, 2017 Thank you guys, jguinch and AdamUL, you're guys' solution works!
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