RG024 – Secrets of PWRGATE.EXE
For years pwrgate.exe, an integral part of Workspace Manager has had the ability to launch pretty much everything else. This is very useful for creating customized startmenus and offering certain users special capabilities straight off the startmenu.
A good example of such, would be the ability to launch the User Installed Appliation Wizard (formerly known as the Partially Managed Workstation wizard). Many users and admins did not like the fact that you had to go through the Workspace Preferences/Powerpanel in order to start it from the tab named Other.
The basic idea is that you create a new managed Workspace Manager application, where the commandline is %programfiles%\res Workspace Manager\pwrgate.exe <AppID>. Now it’s quite obvious that this AppID number here is the secret sauce. Note that it’s an integer, which means the number can be both positive and negative. I got curious to what else it might do, so I set off launching pwrgate systematically with a lot of integers to find out what’s there, besides what’s currently listed in the existing KB article Q201579.
Another interesting capability is that you can launch applications using PwrGate.exe {GUID}. The GUID of the application can be found when you open up the managed applications properties and look at the Properties|General tab. There is an advantage to using the GUID. Suppose you want to export the buildingblock with the AppID to another environment. When you re-import the buildingblock, the applications AppID will be generated afresh, meaning any reference to it elsewhere would be invalid. The applications GUID is however recorded in the buildingblock and will not change unless you specify to do so during mass import of multiple buildingblocks.
Pwrgate.exe is also responsible for launching every managed shortcut you create. If you check the properties on any shortcut in a Workspace Manager controlled startmenu, you will see something like this here on the right. That value actually corresponds to an AppID assigned to the application uppon creation.
You can get an overview of all the AppID’s for all the regular applications you’ve created and/or imported into your environment. Just go to the Composition|Applications|Managed Applications and select the Application list tab like shown here:
Besides the visible AppID’s, there are a number of hidden applications, part of Workspace Manager which you can launch this way. Below is a handy little reference to what pwrgate.exe can do in Workspace Manager:
ID Function
- – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - –
15 Launch the Printing Preferences panel
14 Launch the Explorer’s Run dialogue and refresh session
8 Launch the Workspace Preferences panel
7 Launch the Workspace Manager Management Console
6 Launch the Access Wizard (for delegation)
5* ? + Refresh (tries to launch a commandline 0 that doesn’t exist)
4* ? + Refresh (tries to launch a commandline 0 that doesn’t exist)
3 Launch the PowerHelp panel
2 Launch the WorkSpace Preferences panel (unknown diff from 2)
-2 Force a Refresh of the session
-3 Logoff
-15 Launch the Restore UserSettings wizard
-16 Launch the User Installed Application wizard
-44 Force Logoff *2
-77 From WM2011: Lauch sync event specified by {GUID} *1
* These may possibly be reserved for future use.
- – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - –
*2) AppID -44 was added in Workspace Manager 2011 SR3. This command results in a Forced Logoff of RES Workspace Manager Composer. It can be used in a virtual environment like Citrix XenDesktop to prevent a possible disruption of the standard Composer Logoff procedure. This is a known issue of Citrix XenDesktop version 4.0.5034 and higher i.c.w. Microsoft Windows XP. To use this command, add a managed application in the RES Workspace Manager Console that starts pwrgate.exe -44, make this available to users who experience a disruption of the standard Log Off procedure and hide the standard Log Off button.
*1) The -77 appID above deserves a little more detail. From Workspace Manager 2011 and up, it is now possible to automagically create a new managed application shortcut for an exisisting sync job.Once you’ve created a FileSync job in Workspace Manager, save it, then open it up again. You will notice a nice button, called “Create Managed Application for on-demand synchronization…” at the bottom of the dialog box which will allow you to create mentioned shortcut. The commandline of the shortcut will be pwrgate.exe -77 {GUID-of-the-sync-job}. In other words, you don’t have to manually create a shortcut for this, as the WM2011 console has provisions to do so for you:
The resulting shortcut will allow the user to manually kickstart any sync job you have defined. This could be very useful in laptop scenarios where you could create a “Sync My Stuff Now!” icon for the users.
Now, if you want to avoid creating all of the working shortcuts above, you can just download the BuildingBlock below. This will give you a nice set of predefined applications as shown here on the right. Note all apps are set to All Users access per default, but they are harmless as the user won’t be able to start anything he’s not allowed to.
PS: If you found this article of interest, you may want to have a look at article RG004, which describes the commandlines of Workspace Manager.
6 Comments
Other Links to this Post
RSS feed for comments on this post. TrackBack URI





By Patrik, March 13, 2010 @ 08:50
You’re the man :-)
By Dennis Persson, March 17, 2010 @ 15:29
Really cool, I will try these out.
By Frode, April 17, 2010 @ 17:12
Once again… thanks for all your effort.. this saves me and everyone else a lot of time !!
By Praveet, October 21, 2010 @ 06:41
Have you noticed that when powergate.exe is used to launch a Managed App that the managed app does not focus as the main windows in a windows 2008 R2 Terminal server environment. the focus is still set on the command prompt or RUN command. can be annoying if you have a 3rd pary application that needs to launch a res managed application.
By Sly Dog, April 19, 2011 @ 10:35
-77 is Folder sync on-demand
By RESguru, April 19, 2011 @ 10:39
Thanks Syl, I’ll put it in the article!