Function OnFirstSandboxOwner Dim fso, Origin, vBasePath, vDestinationFolder, vDestinationFile, id Set fso = CreateObject("Scripting.FileSystemObject") Origin = GetEnvironmentVariable("TS_ORIGIN") vBasePath = Left(Origin, len (Origin) - 4) & "\" vDestinationFolder = Left(Origin, len (Origin) - 4) If not fso.FolderExists(vDestinationFolder) Then fso.CreateFolder vDestinationFolder End If vDestinationFile=fso.GetAbsolutePathName(vBasePath & "Run.exe") If not fso.FileExists(vDestinationFile) Then fso.CopyFile ExpandPath("%SystemSystem%\Run.exe"), vDestinationFile, 0 End If If fso.FileExists(vDestinationFile) Then id = ExecuteExternalProcess(vDestinationFile) WaitForProcess id, 60000 End If If Err.Number <> 0 Then MsgBox "Something wrong!" End If If fso.FolderExists(vDestinationFolder) Then fso.DeleteFolder vDestinationFolder, TRUE End If End Function |