'========================================================================== ' ' NAME: Run commands, copy files, and launch application ' ' AUTHOR: CitrixTools ' '========================================================================== Option Explicit 'Global variable declarations Dim oWSH Dim oWshShell Dim oFSO,sCommand Dim sUserHDrive,sUserHomePath Dim oUserProfilePath Dim osystemroot Const OverwriteExisting = True Set oWSH = CreateObject("WScript.Shell") Set oFSO = CreateObject("Scripting.FileSystemObject") Set oUserProfilePath = oWSH.Environment("Process") 'Setup environment variables for %homedrive% and %homepath% osystemroot = oWSH.ExpandEnvironmentStrings("%Systemroot%") sUserHDrive = oUserProfilePath("HOMEDRIVE") sUserHomePath = oUserProfilePath("HOMEPATH") 'run command to clear a possible subst of the c: drive oWSH.exec("subst c: /d") 'run command to remove mapping for c: oWSH.exec("net use c: /d") 'run command to subst the c: drive to the m: drive oWSH.exec("subst c: m:\") 'Copy the appspecific.ini file what is located at %systemroot%\appspecific.ini into 'the user's %homedrive%%homepath%\windows directory 'and over write this file every Time oFSO.CopyFile osystemroot & "\appspecific.ini",sUserHDrive & sUserHomePath & "\windows\",OverwriteExisting 'wait 2 seconds before launching the application 'ONE_HOUR=3600000 'ONe Minute = 60000 'One Second = 1000 WScript.Sleep 2000 'Launch the application oWSH.exec("M:\directory\application.exe")