I am trying to convert our old PC's to thin clients.
The easiest way (free) I found was to leave Windows XP on PC's and have the PC launch PN.exe using a VBscript. I have changed HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\Shell from Explorer.exe to wscript "C:\Program Files\Citrix\ICA Client\vbscript.vbs" to run the vbscript as soon as the user logs on to the PC. When the user logs off their session I want the computer to log off too.
This is the script that I am using:
Dim WshShell
set
WshShell = CreateObject("WScript.Shell") Wshshell.Run
Wshshell.Run
"""c:\Program Files\Citrix\ICA Client\pn.exe"" /APP ""Desktop""", 1, True
WshShell.Run
"c:\WINDOWS\system32\psshutdown.exe -o"
The problem that I am having is that the psshutdown.exe runs automatically eventhough the previous Wshshell.Run states pause script and continue after the pn.exe is closed.
If I remove /APP "Dekstop" the script works great but I want the desktop to appear automatically without the user having to see the Program Neighborhood window.
Any help would be appreciated.
you could try tasklist to find a process (eg wfica32.exe)
to use in a do - while loop, ev. including a wscript.sleep 100
after launching the "desktop".
windows xp has shutdown.exe and tasklist.exe integrated
I would change [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] as follows:
"DefaultUserName"="insert_username_here""AutoAdminLogon"="1""AutoLogonCount"=dword:ffffffff"Userinit"="c:\\windows\\system32\\userinit.bat,""DefaultPassword"="insert_pwd_here"
Save this to a REG file and deploy. That will ensure that all users logging in to the workstation are forced to use PN client as the shell.
Here's a sample userinit.bat file:
c:cd \%systemroot%\system32cscript %systemroot%\system32\disclaimxp.vbs
And a sample disclaimxp.vbs file:
Dim WshShell, BtnCode, strCmd
strCmd = "%comspec% /c ""C:\Program Files\Citrix\ICA Client\pn.exe"" /APP ""Desktop"""Set WshShell = WScript.CreateObject("WScript.Shell")strSystemRoot = WshShell.ExpandEnvironmentStrings("%SystemRoot%")DoBtnCode=WshShell.Popup("Insert disclaimer text here or NO to shutdown your computer", 0, "Please acknowledge and read this disclaimer", 4 + 32)'Exit code values - Y is a 6, N is a 7IF BtnCode=6 then WshShell.Run strCmd,3,TrueIf BtnCode=7 then WshShell.Run "shutdown -s -f -t 0",3,TRUELoop
Alan Osborne
President (MCSE, CCNA, VCP, CCA)
VCIT Consulting - Citrix/Terminal Services Remote Desktop Solutions for SMB
VCIT website My Blog
Thanks for your help guys.
I decided to search for the wfica32.exe in my vbscript. The script will be in a continuous loop until the wfica32.exe is closed. After that, I use a shutdown command to log off the user. The script is below.
Dim WshShellset WshShell = CreateObject("WScript.Shell")
Wshshell.Run """c:\Program Files\Citrix\ICA Client\pn.exe"" /APP ""Desktop""", 1, True
Process_Checker = TrueFound_it = FalseCounter = 0 wscript.sleep 1000
Do Set wmiColl = GetObject("WinMgmts:root/cimv2").ExecQuery("Select * FROM Win32_Process") For Each wmiObj In wmiColl If LCase(wmiObj.Caption) = "wfica32.exe" Then Found_it = True End If Next If Found_it <> True Then Process_Checker = False End If Counter = Counter + 1 Found_it = False wscript.sleep 2000 Loop Until Process_Checker = False
Call WshShell.Run("shutdown -l", 1, True)
Once again, thanks for your help.
Hi,
try and have a look at thinstation OS. Its free and easy to implement.
greetings,Marcus
Can somebody please suggest a code (vbscript peferably) to display the 'About Program Neighborhood' window? pn.exe displays the 'Program neighborhood' window.
Or if anybody can suggest code in Vbscript to display the Citrix version number, it will be more than welcome.
Thanks in advance.