I was looking for a vb script tocreate a printer connection to a local client side printer. Assuming the printer share name is always the same but the clientr name will change. %clientname% gives the correct client name. deleting the printers at log off would be nice as well.
This is for a TS2008 enviroment. Using easyprint or allowing the printers to auto create dont work for this specific printer model. Thats why i want to share the printers on the client machines (all with the same share name) and map the printer based on %clientname% when they log into a TS session on the server.
Cheers
Got it working used this.
Dim netPrinter, UNCpathSet Sh = CreateObject("WScript.Shell")sys = Sh.ExpandEnvironmentStrings("%CLIENTNAME%")User = CreateObject("WScript.Network").UsernameSh.LogEvent 4, "Logon by " & User & " from " & sysUNCpath = "\\" & sys & "\EPSONTM-" Set netPrinter = CreateObject("WScript.Network") netPrinter.AddWindowsPrinterConnection UNCpath