Microsoft KB Archive/931811

= How to start program in full-screen mode from an .osd file in SoftGrid =

Article ID: 931811

Article Last Modified on 5/25/2007

-

APPLIES TO


 * Microsoft SoftGrid for Terminal Services
 * Microsoft SoftGrid for Windows Desktops

-



INTRODUCTION
This article describes three methods that you can use to start a program in full-screen mode from an .osd file.



Method 1: Use a .bat file
To use a .bat file to configure an .osd file to start an .exe file in full-screen mode, following these steps:  Create a .bat file that has the following information:

start /MAX &quot; :\ \ \ .exe&quot;

 Use a text editor, such as Notepad, to open the .osd file. Configure the FILENAME attribute and the PARAMETERS attribute as follows:

FILENAME=&quot;%SFT_MNT%\ \ \ .bat&quot; PARAMETERS=&quot;&quot;

 Save the .osd file.

You cannot specify the %SFT_MNT% variable in a .bat file. However, you can configure the .bat file to read the DriveLetter registry entry from the registry of the client computer that is running the SoftGrid Client. To do this, create a .bat file that has the following code: start /w regedit /e &quot;%TEMP%\SoftGrid_AppFS.txt&quot; &quot;HKEY_LOCAL_MACHINE\Software\Softricity\SoftGrid Client\CurrentVersion\AppFS&quot; type &quot;%TEMP%\SoftGrid_AppFS.txt&quot; | find &quot;DriveLetter&quot; > &quot;%TEMP%\SoftGrid_DriveLetter.txt&quot; for /f &quot;tokens=2 delims==&quot; %%x in (%TEMP%\SoftGrid_DriveLetter.txt) do set DriveLetter=%%~x del /Q &quot;%TEMP%\SoftGrid_AppFS.txt&quot; del /Q &quot;%TEMP%\SoftGrid_DriveLetter.txt&quot; start /MAX &quot;%DriveLetter%\DefaultApp\DefaultApp.exe&quot;

Method 2: Use a .vbs script file
To create a .vbs script file to start an .exe file in full-screen mode, follow these steps:   Create a .vbs script file that has the following information. Set shell = CreateObject(&quot;wscript.shell&quot;) Launch = shell.run(&quot;drive letter:\package root directory\path\filename.exe&quot;,3) Note The value &quot;3&quot; in this code indicates full-screen mode.  Use a text editor, such as Notepad, to open the .osd file.</li> Configure the FILENAME attribute and the PARAMETERS attribute as follows:

FILENAME=&quot;%SystemRoot%\system32\wscript.exe&quot; PARAMETERS=&quot;%SFT_MNT%\ \ \ .vbs&quot;

</li> Save the .osd file.</li></ol>

You cannot specify the %SFT_MNT% variable in the .vbs script file. However, you can configure the .vbs script file to read the DriveLetter registry entry from the registry of the client computer that is running the SoftGrid Client. To do this, create a .vbs script file that has the following code: Set shell = CreateObject(&quot;wscript.shell&quot;) DriveLetter = shell.RegRead(&quot;HKLM\Software\Softricity\SoftGrid Client\CurrentVersion\AppFS\DriveLetter&quot;) Launch = shell.run(DriveLetter & &quot;\DefaultApp\DefaultApp.exe&quot;,3)

How to use a .vbs file to use a .lnk file to start an .exe file in full-screen mode
 Right-click the .exe file, and then click Create Shortcut.</li> Right-click the .lnk file for the shortcut that you created in step 1, and then click Properties.</li> Click the Shortcut tab.</li> In the Run box, click Maximized.</li> Click OK.</li>  Create a .vbs script file that has the following information: Set shell = CreateObject(&quot;wscript.shell&quot;) Launch = shell.run(&quot;drive letter:\package root folder\path\filename.lnk&quot;) Note You cannot specify the %SFT_MNT% variable in the .lnk file. </li> Use a text editor to open the .osd file.</li> Configure the FILENAME attribute and the PARAMETERS attribute as follows:

FILENAME=&quot;%SystemRoot%\system32\wscript.exe&quot; PARAMETERS=&quot;%SFT_MNT%\ \ \ .vbs&quot;

</li> Save the .osd file.</li></ol>

You cannot specify the %SFT_MNT% variable in the .vbs file. However, you can configure the .vbs file to read the DriveLetter registry entry from the registry of the client computer that is running the SoftGrid Client. To do this, create a .vbs file that has the following code: Set shell = CreateObject(&quot;wscript.shell&quot;) DriveLetter = shell.RegRead(&quot;HKLM\Software\Softricity\SoftGrid Client\CurrentVersion\AppFS\DriveLetter&quot;) Launch = shell.run(DriveLetter & &quot;\DefaultApp\DefaultApp.lnk&quot;)

Method 3: Use a .vbs file that is created when an .osd file starts
You can configure an .osd file to start a .vbs file when the .osd file starts. This .vbs file starts the .exe file in full-screen mode. To configure this .osd file, follow these steps:  Use a text editor to open the .osd file.</li> Add the following text to the .osd file:

<SCRIPT TIMING=&quot;PRE&quot; EVENT=&quot;LAUNCH&quot; WAIT=&quot;TRUE&quot; PROTECT=&quot;FALSE&quot;>

<SCRIPTBODY>

@findstr /B /V @ %0 > &quot;%TEMP%\\SoftGrid_Temporary.vbs&quot; \n

Set shell = CreateObject(&quot;wscript.shell&quot;) \n

DriveLetter = shell.RegRead(&quot;HKLM\Software\Softricity\SoftGrid Client\CurrentVersion\AppFS\DriveLetter&quot;) \n

Launch = shell.run(DriveLetter & &quot;\\ \\ \\ &quot;,3)

</SCRIPTBODY>

</SCRIPT>

</li> Configure the FILENAME attribute and the PARAMETERS attribute as follows:

FILENAME=&quot;%SystemRoot%\system32\wscript.exe&quot;

PARAMETERS=&quot;%TEMP%\SoftGrid_Temporary.vbs&quot;

</li> <li>Save the .osd file.</li></ol>

You can configure the .osd file to delete the .vbs file from the %TEMP% folder when the .exe file exits. To do this, follow these steps: <ol> <li>Use a text editor to open the .osd file.</li> <li>Add the following text to the .osd file.

<SCRIPT TIMING=&quot;POST&quot; EVENT=&quot;SHUTDOWN&quot; WAIT=&quot;TRUE&quot; PROTECT=&quot;FALSE&quot;>

<SCRIPTBODY>

erase /Q &quot;%TEMP%\SoftGrid_Temporary.vbs&quot;

</SCRIPTBODY>

</SCRIPT>

</li> <li>Save .osd file.</li></ol>