5.1

Table Of Contents
ThinApp User’s Guide
86 VMware, Inc.
Examples
You can exit the process and indicate success.
ExitProcess 0
When the process exits, the scripting system receives its OnLastProcessExist function callback. Any loaded
DLLs run termination code to clean up the environment.
ExpandPath
The ExpandPath(InputPath) function converts a path from macro format to system format.
Parameters
InputPath
[in] A path in macro format.
Returns
The expanded macro path in system format.
Examples
Path = ExpandPath("%ProgramFilesDir%\Myapp.exe")
Path = C:\Program Files\myapp.exe
All macro paths must escape the % and # characters by replacing these characters with #25 and #23.
Path = ExpandPath("%ProgramFilesDir%\FilenameWithPercent#25.exe")
This expands to C:\Program Files\FileNameWithPercent%.exe.
ExecuteExternalProcess
The ExecuteExternalProcess(CommandLine) function runs a command outside of the virtual
environment. You can use this function to make physical system changes.
Parameters
CommandLine
[in] Representation of the application and command-line parameters to run outside of the virtual
environment.
Returns
Integer process ID. You can use the process ID with the WaitForProcess function. See “WaitForProcess” on
page 91.
Examples
ExecuteExternalProcess("C:\WINDOWS\system32\cmd.exe /c copy C:\systemfile.txt
C:\newsystemfile.txt")
You can run a command that requires quotation marks in the command line.
ExecuteExternalProcess("regsvr32 /s " & chr(34) & "C:\Program Files\my.ocx" & chr(34))