Hello all,

I've been looking through the posts in relation to switching print servers at our office and I have a very basic question or two. I'm just looking for a simple approach to move users from print queues on one print server to print queues on another (new) print server. I was planning on using the same print share names.

I just wanted to add some code to my current login script and make the change on users computers as they log into the network. The office computes are about 99% XP and 1% Windows 7.

Here's one of the codes that was suggested by someone that looked pretty straight forward:

 Code:
$NewServer="\\new\"
$OldServer="\\old\"
$Cnt=0
$SubKey= "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Printerports"
$PrintName=EnumValue ($SubKey, $Cnt)
While $PrintName <> ""
       If Left($PrintName, Len($OldServer))=$OldServer
               $NewPrintName=$NewServer + SubStr($PrintName,Len($OldServer) + 1,Len($PrintName))
        ? "Deleting; " $PrintName "..."
        $= DelPrinterConnection("$PrintName")
        ? @SERROR
        ? "Connecting; " $NewPrintName "..."
        $= AddPrinterConnection("$NewPrintName")
        ? @SERROR
Else
        $Cnt= $Cnt + 1
Endif
$PrintName=EnumValue ($Subkey, $Cnt)

Loop



Now to show how little I know....if I added this code to my current login script (and normally I would add it to the end of my login script), would it run the whole login script multiple times because there is a "loop" call in it? If that is the case, I assume I could get around it by putting it in the beginning of my login script?

There are of course plenty of other printer queue migration scripts on this board....again, I just choose this one since it was recommended by someone.

Any help, comments, or suggestions are very welcomed.

Thank you for your time.