bbc Posted March 9, 2020 Share Posted March 9, 2020 I am trying to grab all the chrome process ids . So I am using the script for /f "tokens=2" %a in ('tasklist /nh /fi "imagename eq chrome.exe"') do echo %a in command prompt and I am able to see all the process ids for chrome . But i wanted to run this script with autoit during my webautomation . Here is the code . var au = require('autoit'); au.Init(); au.Run('for /f "tokens=2" %a in ('tasklist /nh /fi "imagename eq chrome.exe"') do echo %a'); Console.log("Chrome browser sessions: " + a1); When I ran the code , I am unable to see any output in console. Please help me Thank you Link to comment Share on other sites More sharing options...
Developers Jos Posted March 9, 2020 Developers Share Posted March 9, 2020 Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team 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 More sharing options...
bbc Posted March 9, 2020 Author Share Posted March 9, 2020 I am trying to grab all the chrome process ids . So I am using the script for /f "tokens=2" %a in ('tasklist /nh /fi "imagename eq chrome.exe"') do echo %a in command prompt and I am able to see all the process ids for chrome . But i wanted to run this script with autoit during my webautomation . Here is the code . var au = require('autoit'); au.Init(); au.Run('for /f "tokens=2" %a in ('tasklist /nh /fi "imagename eq chrome.exe"') do echo %a'); Console.log("Chrome browser sessions: " + a1); When I ran the code , I am unable to see any output in console. Please help me Thank you Link to comment Share on other sites More sharing options...
bbc Posted March 9, 2020 Author Share Posted March 9, 2020 I am trying to grab all the chrome process ids . So I am using the script for /f "tokens=2" %a in ('tasklist /nh /fi "imagename eq chrome.exe"') do echo %a in command prompt and I am able to see all the process ids for chrome . But i wanted to run this script with autoit during my webautomation . Here is the code . var au = require('autoit'); au.Init(); au.Run('for /f "tokens=2" %a in ('tasklist /nh /fi "imagename eq chrome.exe"') do echo %a'); Console.log("Chrome browser sessions: " + a1); When I ran the code , I am unable to see any output in console. Please help me Thank you Link to comment Share on other sites More sharing options...
Developers Jos Posted March 9, 2020 Developers Share Posted March 9, 2020 How often are you planning to create a thread with the same question? I have merged the 3 you have created into the correct forum, so let's stick to this one please! 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 More sharing options...
bbc Posted March 9, 2020 Author Share Posted March 9, 2020 Can you let me know the link of correct forum that you are referring to ? Thanks Link to comment Share on other sites More sharing options...
Developers Jos Posted March 9, 2020 Developers Share Posted March 9, 2020 (edited) It is already moved to the correct forum as the move post also states and I guess you can see for yourself which forum you are in now. Edited March 9, 2020 by 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 More sharing options...
bbc Posted March 9, 2020 Author Share Posted March 9, 2020 Okay . Can you help me with the solution ? Link to comment Share on other sites More sharing options...
Subz Posted March 9, 2020 Share Posted March 9, 2020 You could just use ProcessList("Chrome.exe") which will return an array of all Chrome processes. Link to comment Share on other sites More sharing options...
Danp2 Posted March 9, 2020 Share Posted March 9, 2020 @Subz It appears that he is using AutoitX, so ProcessList isn't available. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
bbc Posted March 9, 2020 Author Share Posted March 9, 2020 Yes , i didn't see the processlist . I am only able to see WinGetProcess Link to comment Share on other sites More sharing options...
Developers Jos Posted March 9, 2020 Developers Share Posted March 9, 2020 3 hours ago, Danp2 said: he is using AutoitX, Mmm.. guess I moved it to the wrong place initially. It is now in the support forum for AutoitX. 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 More sharing options...
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