Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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

1 Answer 1

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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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