Example script. Heavily edited to gt under 2000 chars
dim fsys, wShell, WNet
Set fSys = CreateObject ("Scripting.FileSystemObject") Set wShell = WScript.CreateObject("WScript.Shell")
Set WNet = WScript.CreateObject("WScript.Network")
dim System_Root, System_Drive, Citrix_Sys, TermServ_Sys, Serv_Sys dim LogonServer, UserProfile, ComputerName, DebugFile
System_Root = wShell.ExpandEnvironmentStrings("%SystemRoot%")
System_Drive = wShell.ExpandEnvironmentStrings("%SystemDrive%")
Citrix_Sys = System_Root & "\System32\Qfarm.exe"
New_Citrix = System_Root & "\System32\newfarm.exe"
TermServ_Sys = System_Root & "\System32\termsrv.exe"
Serv_Sys = System_Drive & "\norun\"
LogonServer = wShell.ExpandEnvironmentStrings("%logonserver%")
UserProfile = wShell.ExpandEnvironmentStrings("%UserProfile%")
ComputerName = wShell.ExpandEnvironmentStrings("%ComputerName%")
UserName = UCase(wShell.ExpandEnvironmentStrings("%UserName%"))
ComputerLocation = Ucase(Left(ComputerName,2))
On Error Resume Next
Err.Description
Do_Citrix = 0
If fSys.FileExists(Serv_Sys) Then WScript.Quit() If fSys.FileExists(TermServ_Sys) Then
If fSys.FileExists(Citrix_Sys) or fSys.FileExists(New_Citrix) Then Do_Citrix = 1
Else
WScript.Quit()
End If
End If
dim LocServ, fdrive
If (Do_Citrix <> 1) Then
select case ComputerLocation
case "JH"
LocServ = "JHSANCLUS"
case "ST"
LocServ = "STSANCLUS"
case else
LocServ = "STSANCLUS"
End Select
fdrive = "\\" & LocServ & "\PWV50"
End If
dim EPO_Install_String
If (Do_Citrix <> 1 ) Then
If NOT ComputerLocation = "IM" Then
Const EPO_Client_LocalLocn = "C:\EPOAgent\naimas32.exe"
EPO_Install_String = FDrive & "\framepkg.exe /s"
If NOT fsys.FileExists(EPO_Client_LocalLocn)Then wShell.Run EPO_Install_String, 0 ,False
End If
End If
Set wShell = Nothing
Set fSys = Nothing