Need to call a script at logon based on hostname. Win 2k3 Domain and XP/7 workstations.
Posted
by
Malocchio
on Server Fault
See other posts from Server Fault
or by Malocchio
Published on 2011-01-13T21:57:43Z
Indexed on
2011/01/13
22:55 UTC
Read the original article
Hit count: 166
I have a user logon script. I want to install printers based on hostname. Inside this folder \domain.local\SYSVOL\domain.local\Policies{DF3F608C-8D78-934F-B79F-1965F3C4409B}\User\Scripts\Logon
I have cmd files for each host/workstation and the logon.cmd.
Terminal Servers are honoring the environment variable %clientname% but the workstations are not.
Relevant area of logon.cmd
rem Delete all existing printer connections
c:\windows\system32\con2prt.exe /f
rem Call workstation specific script for connecting to printers
%clientname%.cmd
Excerpt from clientname.cmdL:
rundll32 printui,PrintUIEntry /in /n\\fileserv\PhaserPS
rundll32 printui,PrintUIEntry /in /n\\fileserv\CanonIR
rundll32 printui,PrintUIEntry /y /n\\fileserv\CanonIR
© Server Fault or respective owner