I want to have a script that does the following thing:

  1. connect to a remote windows machine
  2. get the list of applications that are currently open on the machine, e.g exactly what I would get in the "applications" tab in the task manager, and print it.

Is it possible to do that in batch? If not, what other options do I have?

  • tasklist will show you all running processes. Works in most newer versions of windows. – Kiwi Mar 12 '10 at 13:25
  • @kiwi - Thanks, but I don't want processes, rather applications – olamundo Mar 12 '10 at 13:33
  • Well how could your OS tell the difference between applications and processes? – Kiwi Mar 12 '10 at 13:44
  • @kiwi - if I open taskmanager -> the "applications" tab, the OS shows me what I want, so apparently it has a way of telling the difference... – olamundo Mar 12 '10 at 13:53

If you have powershell installed, the following will get you a list of running applicaitons when run locally

gps | ? {$_.mainwindowtitle.length -ne 0} | select name, mainwindowtitle

If you have Powershell V2 installed on the machines you want to query, and remoting enabled, you can then run:

invoke-command –computername <remote computer name> 
{gps | ? {$_.mainwindowtitle.length -ne 0} | select name, mainwindowtitle}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.