Microsoft KB Archive/931811

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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.

MORE INFORMATION

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:

  1. Create a .bat file that has the following information:

    start /MAX "Drive letter:\Package root folder\Path\Filename.exe"

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

    FILENAME="%SFT_MNT%\package root directory\path\filename.bat" PARAMETERS=""

  4. 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 "%TEMP%\SoftGrid_AppFS.txt" "HKEY_LOCAL_MACHINE\Software\Softricity\SoftGrid Client\CurrentVersion\AppFS"
type "%TEMP%\SoftGrid_AppFS.txt" | find "DriveLetter" > "%TEMP%\SoftGrid_DriveLetter.txt"
for /f "tokens=2 delims==" %%x in (%TEMP%\SoftGrid_DriveLetter.txt) do set DriveLetter=%%~x
del /Q "%TEMP%\SoftGrid_AppFS.txt"
del /Q "%TEMP%\SoftGrid_DriveLetter.txt"
start /MAX "%DriveLetter%\DefaultApp\DefaultApp.exe"

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:

  1. Create a .vbs script file that has the following information.

    Set shell = CreateObject("wscript.shell")
    Launch = shell.run("drive letter:\package root directory\path\filename.exe",3)

    Note The value "3" in this code indicates full-screen mode.

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

    FILENAME="%SystemRoot%\system32\wscript.exe" PARAMETERS="%SFT_MNT%\package root directory\path\filename.vbs"

  4. Save the .osd file.

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("wscript.shell")
DriveLetter = shell.RegRead("HKLM\Software\Softricity\SoftGrid Client\CurrentVersion\AppFS\DriveLetter")
Launch = shell.run(DriveLetter & "\DefaultApp\DefaultApp.exe",3)

How to use a .vbs file to use a .lnk file to start an .exe file in full-screen mode

  1. Right-click the .exe file, and then click Create Shortcut.
  2. Right-click the .lnk file for the shortcut that you created in step 1, and then click Properties.
  3. Click the Shortcut tab.
  4. In the Run box, click Maximized.
  5. Click OK.
  6. Create a .vbs script file that has the following information:

    Set shell = CreateObject("wscript.shell")
    Launch = shell.run("drive letter:\package root folder\path\filename.lnk")

    Note You cannot specify the %SFT_MNT% variable in the .lnk file.

  7. Use a text editor to open the .osd file.
  8. Configure the FILENAME attribute and the PARAMETERS attribute as follows:

    FILENAME="%SystemRoot%\system32\wscript.exe" PARAMETERS="%SFT_MNT%\package root directory\path\filename.vbs"

  9. Save the .osd file.

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("wscript.shell")
DriveLetter = shell.RegRead("HKLM\Software\Softricity\SoftGrid Client\CurrentVersion\AppFS\DriveLetter")
Launch = shell.run(DriveLetter & "\DefaultApp\DefaultApp.lnk")

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:

  1. Use a text editor to open the .osd file.
  2. Add the following text to the .osd file:

    <SCRIPT TIMING="PRE" EVENT="LAUNCH" WAIT="TRUE" PROTECT="FALSE">
    <SCRIPTBODY>
    @findstr /B /V @ %0 > "%TEMP%\\SoftGrid_Temporary.vbs" \n
    Set shell = CreateObject("wscript.shell") \n
    DriveLetter = shell.RegRead("HKLM\Software\Softricity\SoftGrid Client\CurrentVersion\AppFS\DriveLetter") \n
    Launch = shell.run(DriveLetter & "\\package root directory\\path\\filename.exe",3)
    </SCRIPTBODY>
    </SCRIPT>

  3. Configure the FILENAME attribute and the PARAMETERS attribute as follows:

    FILENAME="%SystemRoot%\system32\wscript.exe"
    PARAMETERS="%TEMP%\SoftGrid_Temporary.vbs"

  4. Save the .osd file.

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:

  1. Use a text editor to open the .osd file.
  2. Add the following text to the .osd file.

    <SCRIPT TIMING="POST" EVENT="SHUTDOWN" WAIT="TRUE" PROTECT="FALSE">
    <SCRIPTBODY>
    erase /Q "%TEMP%\SoftGrid_Temporary.vbs"
    </SCRIPTBODY>
    </SCRIPT>

  3. Save .osd file.

Notes

  • If the path that is specified in the PARAMETERS attribute contains a space, enclose the path in parentheses ("). For example, configure the attribute as follows:

    FILENAME="%SystemRoot%\system32\wscript.exe" PARAMETERS=""%SFT_MNT%\The default application\DefaultApp.vbs""

  • You cannot use the TERMINATECHILDREN="TRUE" attribute when you perform any of the three methods in this article. If you use this attribute, the program will exit immediately after it starts.
  • If you use Method 1 or Method 3, a Command Prompt window is briefly displayed when the program starts.
  • The .bat file, the .vbs file, and the .lnk file are in the sequence for the examples in this article. However, you can place these files in other locations.
  • The user who is starting the program must have the .bat file, the .vbs file, and the .lnk file. Additionally, the user must have the appropriate permissions to run scripts.
  • The .osd file does not contain an option to start programs in full-screen mode.


Keywords: kbhowto kbexpertiseinter KB931811