quick question: I need the NT 4 commands to map a network drive, and send a file to a network printer. Its for an tedious series of tasks I need to automate with a batch file, I'd appreciate any help you can give me.
Printable View
quick question: I need the NT 4 commands to map a network drive, and send a file to a network printer. Its for an tedious series of tasks I need to automate with a batch file, I'd appreciate any help you can give me.
to connect to a network drive
net use x: \\computername\sharename
add the /persistant flag to make it "permanent"... meaning it will still be there after reboot
x can be replace by any drive letter available
to delete that drive mapping
net use x: /delete
to print (not sure if it works or not, never used it)
net print
use
net use /?
net print /?
for all the options
type
net
for all the net commands
Just a minor correction, it has to be net use x: instead of net use x. I just tested it and x didn't work but x: did. Same goes for deleting it. Peace
edit
I was looking at the output for net print /? and I don't think you can send a file to the printer from the command line, at least not with what it gives you from the /? command.
You may want to look into the lpr command: lpr /?
I just tried it and apparently the printer or server or whatever has to be running the ldp service, whatever that is. I'm still searching though, so I could find your solution.
You may want to look into this program: http://home.swipnet.se/~w-62144/prfile/descr.htm
It looks to be able to print to a network printer from the command line. Good luck.
h3r3tic: thanks for the correction.
I wasn't sure about the net print command as I've never used it. I don't have a network printer right here to test it on. I should have said that when I posted.
Either way, thanks for the correction. I typed that out so quickly and I didn't test it...
Misinformation is one of the things I hate most... and thats exaclty what I did. :(
I just made a file called help.rtf then I did this command at the command prompt:
print /D:\\server\printer c:\path\to\file\help.rtf
and it printed only it didn't print it correct, that is probably because of the type of file or encoding. You can fool around with that for a while.
edit
it worked just fine if I saved the file as help and selected "Text Document - MS-DOS Format" for the file format.
thank you both very much for your help, I will monkey around with these commands until I get the system to work. thanks again.