Wednesday, September 23, 2009

Creating Shortcut to Application Inside Windows XP Mode

The easiest way to get a Windows 7 shortcut to an application inside XP Mode is to load up the Virtual Machine and within the guest Windows XP, create a shortcut in C:\Documents and Settings\All Users\Start Menu.

This method can be used to create shortcut for Internet Explorer 6 and Outlook Express. However, when I use the same method to create a shortcut to Pinball Space Cadet, the Windows 7 shortcut isn’t created.

I found out that there is a manual way to create shortcut. The steps are as follows

  1. In Windows XP, create the registry entries for the Terminal Services Application Allowed List
  2. In Windows 7, create a shortcut to the application in XP Mode.

Creating the registry entries

I will attempt to create a shortcut to Pinball. The following is the registry entry I created.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TsAppAllowList\Applications\1234567]
"CommandLineSetting"=dword:00000000
"IconIndex"=dword:00000000
"IconPath"="%SYSTEMDRIVE%\\Program Files\\Windows NT\\Pinball\\PINBALL.EXE"
"Name"="Pinball"
"Path"="C:\\Program Files\\Windows NT\\Pinball\\PINBALL.EXE"
"RequiredCommandLine"=""
"ShortPath"="C:\\PROGRA~1\\WINDOW~1\\Pinball\\PINBALL.EXE"
"ShowInTSWA"=dword:00000000
"VPath"="%SYSTEMDRIVE%\\Program Files\\Windows NT\\Pinball\\PINBALL.EXE"

image

The “1234567” part in [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TsAppAllowList\Applications\1234567] is some random numbers that I had come up with. This number will be used later in the Windows 7 shortcut.

The "CommandLineSetting"=dword:00000000 "IconIndex"=dword:00000000 "RequiredCommandLine"="" "ShowInTSWA"=dword:00000000 are some default values that I have copied over from the 5664112 entry, which is the entry to Internet Explorer 6.

"IconPath"="%SYSTEMDRIVE%\\Program Files\\Windows NT\\Pinball\\PINBALL.EXE" determines what icon will be used. Windows 7 will extract the icon at this location and store it in Windows 7’s folder at %USERPROFILE%\AppData\Local\Microsoft\Windows Virtual PC\Virtual Applications\Windows XP Mode

"Name"="Pinball" is used for naming the icon that is extracted in the previous step. It will be used in the Windows 7 shortcut later.

"Path"="C:\\Program Files\\Windows NT\\Pinball\\PINBALL.EXE" and "VPath"="%SYSTEMDRIVE%\\Program Files\\Windows NT\\Pinball\\PINBALL.EXE" are the path to Pinball.

"ShortPath"="C:\\PROGRA~1\\WINDOW~1\\Pinball\\PINBALL.EXE" is the 8.3 path to Pinball.

We can get the 8.3 filenames step-by-step. To get the 8.3 filename of c:\Program files, type cd \ dir "Program files*" /x You will see something similar to Volume in drive C has no label. Volume Serial Number is 24FE-A31E

Directory of C:\

07/26/2009 05:57 PM <DIR> PROGRA~1 Program Files 0 File(s) 0 bytes 1 Dir(s) 134,463,721,472 bytes free

PROGRA~1 is hence the 8.3 filename for Program files.

image

Creating the Windows 7 shortcut

Create a shortcut in C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Windows Virtual PC

image

Set the Target to %SystemRoot%\system32\rundll32.exe %SystemRoot%\system32\VMCPropertyHandler.dll,LaunchVMSal "Windows XP Mode" "||1234567" "Pinball"

"||1234567" "Pinball" correspond to the random number and the Name that I have specified in the Create the registry entries step.

3 comments:

Anonymous said...

Thanks this was very helpful, just what I was looking for, Stephen

Aloy said...

Hi,

Great suggestion. However, I just found this article and it seems to work great. Check out bullet point # 4:

http://blogs.msdn.com/virtual_pc_guy/archive/2009/10/28/understanding-and-troubleshooting-auto-publishing-in-windows-virtual-pc.aspx

Basically you delete the registry entry from the list pertaining to the application you want and it appears in the Windows 7 start menu. I did this with explorer.exe and it showed up instantly.

Thanks again!

Jeow Li Huan said...

Thanks a lot! That's so much easier.