' Declare constants for Run options
Const NOWAIT = 0
Const WAIT = 1
Const HIDE = 0
Const ACTIVATE = 1
Const ACTIVATEMIN = 2
Const ACTIVATEMAX = 3
Dim objshell
Dim STarget
Set objShell=CreateObject("Wscript.Shell")
Set objFS=CreateObject("Scripting.FileSystemObject")
Run "msiexec.exe /i ""Nero.msi"" TRANSFORMS=""Nero 7.0.mst"" ROOTDRIVE=""c:\"" /qn /norestart /l*v ""%windir%\logs\Nero7.0.log""" ,0,1
Run "xcacls.exe ""%programfiles%\Nero"" /T /Y /G Administrators:f",0,1
Run "xcacls.exe ""%programfiles%\Nero"" /T /Y /E /G ""MRP\APPDEPLOY-Nero 7.0"":f",0,1
ALLUSERS= GetEnvVar("allusersprofile")
CurrentUser= GetEnvVar("userprofile")
'Wait for shortcuts to be created
StartTime = Timer
sTarget=ALLUSERS & "\desktop\Nero Home.lnk"
While Not objFS.FileExists(sTarget)
Wend
sTarget=ALLUSERS & "\desktop\Nero StartSmart.lnk"
While Not objFS.FileExists(sTarget)
Wend
sTarget=ALLUSERS & "\Start Menu\Programs\Nero 7 Premium\Nero ProductSetup.lnk"
While Not objFS.FileExists(sTarget)
Wend
'sTarget=CurrentUser & "\Application Data\Microsoft\Internet Explorer\Quick Launch\Nero Home.lnk"
'While Not objFS.FileExists(sTarget)
'Wend
'sTarget=CurrentUser & "\Application Data\Microsoft\Internet Explorer\Quick Launch\Nero StartSmart.lnk"
'While Not objFS.FileExists(sTarget)
'Wend
DeleteFile ALLUSERS & "\desktop\Nero Home.lnk"
DeleteFile ALLUSERS & "\desktop\Nero StartSmart.lnk"
DeleteFile ALLUSERS & "\Start Menu\Programs\Nero 7 Premium\Nero ProductSetup.lnk"
DeleteFile CurrentUser & "\Application Data\Microsoft\Internet Explorer\Quick Launch\Nero Home.lnk"
DeleteFile CurrentUser & "\Application Data\Microsoft\Internet Explorer\Quick Launch\Nero StartSmart.lnk"
' -----------------------------------------------------------------------------
' Subroutine: Run
' Arguments: WhatToRun,WindowState,WaitUntilDone
' Description: Shells out and runs an application
' -----------------------------------------------------------------------------
' Shells out and runs an application
Sub Run(WhatToRun,WindowState,WaitUntilDone)
On Error Resume Next
RunErr = objShell.run (WhatToRun, WindowState, WaitUntilDone)
If RunErr <> 0 and not RunErr = 3010 Then
WScript.echo RunErr
end if
End Sub
' -----------------------------------------------------------------------------
' Subroutine: DeleteFile
' Arguments: FileToDelete
' Description: Deletes a file
' Creates:
' -----------------------------------------------------------------------------
' Deletes a file
Sub DeleteFile(FileToDelete)
On Error Resume Next
objFS.DeleteFile FileToDelete
End Sub
' -----------------------------------------------------------------------------
' Function: GetEnvVar
' Arguments: varname
' Description: Returns the value of an environment variable
' Returns: GetEnvVar
' Creates:
' -----------------------------------------------------------------------------
' Read environment variable
Function GetEnvVar(varname)
varname=LCase(varname)
EnvVarArray = Array("Process","System","User")
For intcount = 0 To UBound(EnvVarArray)
Set ObjEnv = objShell.Environment(EnvVarArray(intcount))
For Each strVar In objEnv
strSplitvar=LCase(strVar)
strSplitvar=Split(strVar,"=")
strVar=strSplitvar(0)
strVarVal=strSplitvar(1)
If lcase(strVar)=varname Then GetEnvVar = strVarval
Next
Next
End FunctionView inventory records anonymously contributed by opt-in users of the K1000 Systems Management Appliance.