Question Locked

Batch File Logon Scripts and Vista

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi, a while back when we only ran XP machines I wrote a log on batch file to map network drives and printers. This was very useful as we have a couple of Citrix servers as well to access a number of applications such as our ERP system.

I have recently put a couple of Vista machines onto the network and the logon script just doesnt work anymore. The logon batch file will however work when logging into Citrix.

It will add the mapped drives but it wont add the printers saying "Windows cannot connect to this printer. The local print spooler service is not running. Please restart the sppoler or restart the machine." The spooler is however running and no amount of restarts etc seem to resolve the issue.

Below is an example of the batch file.

@echo off
net use j: /d /y
net use j: \\hsdc1\jdrive /y
rundll32 printui.dll,PrintUIEntry /in /n \\HSDC1\SupplyChain

The batch file runs from the logons script stored against a user in active directory.

I inherited the logon script to add the network drives from my predecessor, and got the add printer bit from the internet. Ideally the batch file will work for both XP machines and Vista machines. My understanding isn?t what it should be in this area, so any help will be greatly appreciated.

Cheers

3 replies

by tmalo627

Try adding a part to the script that stops the printer spooler service before it adds the printer then restarts it after.

Your script would look something like this

@echo off
net use j: /d /y
net use j: \\hsdc1\jdrive /y
net stop "print spooler"
rundll32 printui.dll,PrintUIEntry /in /n \\HSDC1\SupplyChain
net start "print spooler"

I don't know if it will work, but it's worth a shot.

Let me know if it helps or not.

by lee.russell

Hi thanks for your help on this! That worked spot on, the end user has to press install if its a new driver but thats it.

Cheers

This discussion is closed to new replies.