7 replies
by ben.morton
by greg.gotcher
by nbcasey
If you are just using batch scripting, you can use %clientname%. Works for NT4 and 2K Terminal server. If you are doing some vbscripting and using Citrix, you can use some of Citrix's objects. For Example:
set ica = createobject("Citrix.ICAClient")
computername = "\\" & ica.clientname
Good Luck!
by nbcasey
You can still use the %clientname% in vbscript.. for example:
set oShell = CreateObject("Wscript.Shell")
computername = oShell.ExpandEnvironmentStrings("%clientname%")
As for mapping printers, use the Network object. Ex:
set oNet = CreateObject("Wscript.Network")
oNet.AddWindowsPrinterConnection "\\printserver\printshare"
You can add windows printers from command line, but its a little more complex. You have to make sure the driver names match exactly to what Windows has it as. Ex: Some of the lines below may appear word wrapped, but they are all one line.
REM Adds the printer - This would add a local printer
rundll32 printui.dll,PrintUIEntry /if /b "PRINTERNAME" /f "C:\_950drv\2kxpinf\enu\drivers\win2k_xp\hpf950k.inf" /r "lpt1:" /m "hp deskjet 950c series"
REM Set printer to default..
rundll32 printui.dll,PrintUIEntry /y /n "PRINTERNAME"
REM Adds a network printer
rundll32 printui.dll,PrintUIEntry /in /n "\\printserver\printer"
You can also just do "rundll32 printui.dll,PrintUIEntry /?" to get all the options. This tool can do many cool things! Personally, I would stick with VBScripts. Much easier to manage in my opinion. Hopes this helps.
by greg.gotcher
by greg.gotcher
by greg.gotcher
This discussion is closed to new replies.
Trending Windows Forum posts
Sort by Trending