Q. How can I list all applications being published from a Windows Virtual PC virtual machine (VM)?

A. Run the script below in the VM and all published applications will be listed.

strComputer = "."
strNamespace = "\root\cimv2\TerminalServices"

strQuery = "Select * From Win32_TSPublishedApplication"
Set objSWbemServices = GetObject("winmgmts:\\" & strComputer & strNamespace)

Set colItems = objSWbemServices.ExecQuery (strQuery)

For Each objItem in ColItems
     wscript.echo objItem.Name

The script is shown running below.

C:\>cscript listPubApps.vbs
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft Office Outlook 2003
Microsoft Security Essentials
Microsoft Office Word 2003
Microsoft Office Access 2003
Microsoft Office InfoPath 2003
Internet Explorer
Microsoft Office PowerPoint 2003
Microsoft Office Application Recovery
Microsoft Clip Organizer
Microsoft Office Publisher 2003
Microsoft Office Excel 2003
BitLocker To Go Reader
Microsoft Office Picture Manager
Microsoft Office 2003 Save My Settings Wizard
Microsoft Office Document Imaging

Related Reading:

Check out hundreds more useful Q&As like this in John Savill's FAQ for Windows. Also, watch instructional videos made by John at ITTV.net.
Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.