Mapping LPT1 to local (shared) printer?

C

Cyberdude

Is there another way to map an lpt port to a local printer other than
the syntax below?

net use lpt1 \\%COMPUTERNAME%\MyPrinter
- where MyPrinter is setup as a Shared Printer.

Sometimes this does not work because it cannot find the computername.
It there some other name or syntax I can use that specifies a printer
on the computer the command is being ran on? Is there a vbscript
that will do this?
 
D

Davide Guolo

Cyberdude,
net use lpt1 \\%COMPUTERNAME%\MyPrinter
- where MyPrinter is setup as a Shared Printer.

Sometimes this does not work because it cannot find the computername.

COMPUTERNAME is an environment variable which may be missing on those
machines (you might add it, or directly use the real computer name in
your NET USE command)
It there some other name or syntax I can use that specifies a printer
on the computer the command is being ran on?

you might try %USERDOMAIN%.
Try to open a Command Prompt and run a SET command (without additional
parameters) to see a complete list of the currently configured
environment variables.

Regards,
Davide Guolo
aSwIt s.r.l.
--------------------------------------------------------------
Printfil - Windows Printing System for Applications
http://www.printfil.com
Odbc4All - Connection to ODBC Data Sources for any Application
http://www.aswit.com/odbc4all
@Kill - Batch Close Windows Applications - Freeware
http://www.aswit.com/akill
--------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top