title: Script to add network printer to all users x64 bit print server
body: <p>I use to use this script for Windows XP but since we're doing the switchover to 7 I tried to use it on the new images. It seems like it tries but it doesn't work. I have created a 64bit print server and these machines are 64bit which is the only difference. I read up on this and saw there was a GPO that needed to be set to allow this to work. Which was - Computer Configuration > Administrative Templates > Printers > Allow Print Spooler to accept client connections.</p>
  
  <p>I have tried everything and can't get this to work, it doesn't give me an error or anything. It gives me the prompts for PC name and Printer name, then says 'Adding printer' from the echo command, and just sits there. I can run the command by itself and it doesn't work either....... Please help! </p>
  
  <p>The main thing is that the printer needs to be added from a print server and to the computer for all users as their default.</p>
  
  <pre><code>@echo off
  echo PC Name 
  set /p PC=
  
  echo Printer Name
  set /p PRINTER=
  
  ECHO Adding Printer...
  \\ghostserver\installs\pstools\psexec \\%PC% -n 3 cmd /c rundll32         
  printui.dll,PrintUIEntry /y /ga /c\\%PC% /n\\PRINTSERVER\%PRINTER%
  
  ECHO Restarting Print Spooler...
  start /wait sc \\%PC% stop spooler
  start /wait sc \\%PC% start spooler
  </code></pre>