General discussion


GP vbs Logon Script

By MandaT ·
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.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by MandaT In reply to GP vbs Logon Script

Point value changed by question poster.

Collapse -

by neilb@uk In reply to GP vbs Logon Script

Can you post the script?

Collapse -

by MandaT In reply to

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.

Collapse -

by MandaT In reply to GP vbs Logon Script

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
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
End If
End If
dim LocServ, fdrive
If (Do_Citrix <> 1) Then
select case ComputerLocation
case "JH"
case "ST"
case else
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

Collapse -

by MandaT In reply to GP vbs Logon Script

This question was closed by the author

Related Discussions

Related Forums