Win32_Process examples–running scripts

Back in the day when all we had was VBScript you could run scripts through the command line (cscript) or you would get a more graphical interface (wscript).  One of the examples at shows how to detect running scripts.

I don’t imagine much call for that technique but if you need it – here it is:

Get-CimInstance -ClassName Win32_Process -Filter “Name = ‘cscript.exe’ OR Name = ‘wscript.exe'” |
Format-Table Name, Commandline

You could use a variation to test the command line input to other processes if you need to

This entry was posted in CIM, PowerShell and WMI, PowerShell V3, PowerShell v4. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s