Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

All,

I currently have a samba printer shared at \\%ServerIP%\Printer1 which requires credentials to connect.

Users can easily add the printer with the printer wizard. However, the printer will stop working after a day or two on Windows machines.

To combat this problem, I would like to add the printer each time a user logs on with a script. I have tried this:

echo Adding Printer1 at %ServerIP%

rundll32 printui.dll PrintUIEntry /in /n\\%ServerIP%\Printer1

echo Restarting print spooler so that printer is accessible in dialogs

start /wait sc stop spooler
start /wait sc start spooler

echo Done. Exiting...

But this doesn't work if the printer isn't already installed. How can I make a more robust solution?

Thanks!

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.