Set objShell = CreateObject("Wscript.Shell") Set fsObject = CreateObject("Scripting.FileSystemObject") objShell.Run """" & objShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%") & "\FWSUpdates\bin\on_shutdown.bat" & """", 0, True If fsObject.FileExists(objShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%") & "\FWSUpdates\offline_upgrade.bat") Then objShell.Run """" & objShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%") & "\FWSUpdates\offline_upgrade.bat" & """", 0, True fsObject.DeleteFile(objShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%") & "\FWSUpdates\offline_upgrade.bat") End If