Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Whenever a user logs on to a Windows XP Machine, I want to run a batch script as them that adds network printers. How to do that?

Using the Scheduled Task Wizard, it looks like I'd have to add a scheduled task for every user manually.

share|improve this question

5 Answers 5

up vote 5 down vote accepted

Are the computers joined to a domain or are they using local accounts?

Domain controllers have built-in support for a logon script. There's tons of information out there on this and we'd need more information to guide you here. (What software is your DC running?) GPO is a better option if you are using a Windows Active Directory back end.

It can be done with local accounts, too. MS has a KB entry for it here: How to Assign a Logon Script to a Profile for a Local User

share|improve this answer
    
They're connected in a Samba domain. I didn't think domain controllers could do that, but I searched now and found the "logon script" samba setting. Thanks! –  user58330 Oct 26 '10 at 16:56
    
No problem! Good luck! –  Aaron Copley Oct 26 '10 at 17:00

Are the XP machines all in Active Directory? If so, check out this technet article "Creating logon scripts" for some pointers.

share|improve this answer

If they're on a domain, you can use GPO to set up printers, but we sometimes have print driver installation errors (no one can narrow down why, it's not supposed to happen).

We've run batch files in the c:\documents and settings\all users\start menu\startup folder. Whatever is in that folder gets run by the user when they log in. Just stick the batch file in there. We used to add printers using AdPrintX (freeware) in a batch file using that method.

share|improve this answer

Are the computers members of a domain? If so, you can specify a startup batch (or vbs) file that will run every time the user logs on.

http://www.rlmueller.net/LogonScriptFAQ.htm

If they are not members of a domain (or you do not have privileges to active directory) then your task is harder. Let me know.

share|improve this answer

If the computers are not in a domain write your login script and put it in the Startup folder for the user.

To add the printers use: rundll32 printui.dll
MS's article here

share|improve this answer

Your Answer

 
discard

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