Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default printer via VBS based upon %ClientName%

Status
Not open for further replies.
Mar 26, 2001
81
IE
Hello guru's :)

Can I run something past those with more Citrix/VBS/heck.....just the more knowledgeable!

Does the following look right'ish? I want to call a script from the logon script which will check the ClientName, and depending on the result set a default printer......I went with VBS, so.....

On Error Resume Next
Dim objWshNetwork
Dim objWshShell
Dim strWorkstation 'Local Computer Name
'Get Computername & store as strWorkstation
strWorkstation = WshShell.ExpandEnvironmentStrings("%clientname%")
'Enter into Select Case selection based upon WorkStation name
Select Case strWorkstation
Case "ClientNameWhatever"
objNetwork.SetDefaultPrinter "PrinterWhatever"
End Select
Next

Rgds,
Peter Mannion.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top