1

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.

5 Answers 5

5

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

2
  • 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, 2010 at 16:56
  • No problem! Good luck! Oct 26, 2010 at 17:00
2

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

1

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.

1

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.

0

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

You must log in to answer this question.