Discussion Locked

GP vbs Logon Script

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a vbs logon script that is supposed to run a few exe's if their corresponding apps are not installed (Asset mgmt, AV and SW Dep tool)

When I manually run the code from within XP and W2k and it performs as expected. The executables are run and applications are installed.

But when running the same code as my logon script, the applications are not installed.

Help would be greatly appreciated.

5 replies

by mandat

Poster rated this answer.

The issue turned out to be that I was trying to fire off a window before the user was fully logged in. Are trying a different method.

by mandat

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

This discussion is closed to new replies.