Scripts for XP Home

PLightstar

Part of the furniture
Joined
Dec 29, 2003
Messages
2,103
Which program would I use to create a script or macro to connect to a dot matrix printer when windows starts up. Instead of having to put in

net use lpt1 \\server2\epson /persistent:yes

in the command prompt everytime I start the machine.
 

Doh_boy

Part of the furniture
Joined
Dec 22, 2003
Messages
1,007
Batch file (<whatever>.bat), I'm not sure where to put it mind.

Is there a startup directory still?

C:\Documents and Settings\All Users\Start Menu\Programs\Startup

The above is on 2k so I don't know what it would be on xp. Not much different you'd imagine.
 

MrBlack

Fledgling Freddie
Joined
Dec 24, 2003
Messages
148
You should be just create the .bat file on the desktop, then drag it into the start menu and drop it in the startup folder.

That said, would it not be easier to just add it as a network printer through Control Panel->Printers, or is there a specific reason why you can't do that?
 

phlash

Fledgling Freddie
Joined
Dec 24, 2003
Messages
195
PLightstar said:
net use lpt1 \\server2\epson /persistent:yes

in the command prompt everytime I start the machine.

I would have expected the printer connection to come back when you restart Windows - that's what the /persistent:yes switch is for...

..but popping shortcuts into the Start Menu->Startup folder is the easiest way to run stuff on login.
 

Quige

Fledgling Freddie
Joined
Dec 22, 2003
Messages
118
MrBlack said:
That said, would it not be easier to just add it as a network printer through Control Panel->Printers, or is there a specific reason why you can't do that?
What that man said ... you haven't needed to use that sort of thing since windows 3.11 ... even Windows 95 has the ability to browse to a network printer, install driver from the server, and maintain it all between reboots. If you have multiple people logging on to the PC requiring connecting to different printers then that is surely what user profiles are for.

Unless this is some Windows XP Home special behaviour, not allowing persistant printers on remote queues, like not being able to be a member of a domain. My apologies if so.

Basically what everyone else said, make printer.bat and put your line in

net use lpt1 \\server2\epson

No need for the persistant line as you going to make it happen every log on anyway.

Then put it, or create a shortcut in
C:\Documents and Settings\All Users\Start Menu\Programs\Startup
 

Quige

Fledgling Freddie
Joined
Dec 22, 2003
Messages
118
Or if you want to feel saucy and modern you could make a printer.vbs, instead of the batch file, with something like this inside;

Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\server2\epson"

Though this may not work if Windows XP Home doesn't come with/support
Windows Scripting Host.
 

PLightstar

Part of the furniture
Joined
Dec 29, 2003
Messages
2,103
I've added the printer through the printers folder, but it just comes up unable to communicate even though i've put the computers user name and PC ID in the printers allowed users on the Host machine.

But i'll try what you lot have suggested, thanks very much
 

Users who are viewing this thread

Top Bottom