Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm sure this has come up a million times but i'm looking for a quick answer / solution. I have a client that uses a database program that creates an .ini file for printer settings. The problem is that everytime the enduser logs in her printer is redirected to a "TSXXX" port. this port is constantly changing which is of course normal, but each time she logs in since it has changed the .ini file entry for the printer is incorrect as it has changed. The EU then has to go through the whole printer setup each time she logs in to the TS. Is there a way to statically assign the port? or some how make it constant so each time she log in the port remains the same?

share|improve this question
If it's not possible, can you share her printer out and install it on the 2008R2 server? – KJ-SRS Apr 3 '12 at 20:16

The ugly: make a batch that find the port and update the ini file at logon.

Exemple of script to parse printer (vbscript) (it set default printer to MYSPECIALPRINTER): use objprinter attributes (Path i think) to get tsclient path

Set objNetwork = CreateObject("WScript.Network") 
Set objWMIService = GetObject("winmgmts:" & _
    "{impersonationLevel=Impersonate}!\\" & "." & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
        ("SELECT * FROM Win32_Printer")
    For Each objPrinter in colInstalledPrinters
        '''wscript.echo ("Imprimante : " & objPrinter.Name & VbCrLf)
        If (left(LCase(,4) = "MYSPECIALPRINTER") then

''wscript.echo ("Imprimante : " & objPrinter.Name & VbCrLf)

        End If

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.