Jump to content

Copy A File To Shared Network Printer


Recommended Posts

Hi!

It's me again, Margaret. I have a question as referenced in the topic and description.

Right now, I'm using Word, or Notepad to print straight text document, but was wondering if I could print it directly from the DOS prompt instead?

FileCopy("foo.txt","LPT1") <-- Works for a locally connected printer...doesn't exactly work when you don't have one connected though...kinda locks up the DOS prompt.

I'm just not sure how to send it to a network shared printer.

I've tried (in DOS)

copy test.txt \\MY_TREE\PRINTERNAME.NDPS.PRINTERS.LOCATION.DOMAIN

But ... that doesn't work, returns "Specified path is invalid."

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

ive tried it on the shared printers here at my work and its worked for me

copy test.txt \\printserver_name_or_ip\printer_name

i didnt need anythign after printer_name, i jsut have p099, i see in ur code you have .ndps.printers.location.domain, but i didnt need any of that, maybe try without that stuff?

_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Link to comment
Share on other sites

ive tried it on the shared printers here at my work and its worked for me

copy test.txt \\printserver_name_or_ip\printer_name

i didnt need anythign after printer_name, i jsut have p099, i see in ur code you have .ndps.printers.location.domain, but i didnt need any of that, maybe try without that stuff?

I've tried:

copy test.txt \\10.126.84.106\MAR1SW1_HP8150 <--- No joy. The network path was not found.

the IP is the IP of the printer.

I've tried copying it to the printer ip...no joy....

I just asked our tech and he's reluctant to give out the IP of our NDPS print server for some reason. :/

Is there a way for me to find it?

The structure is PRINTER_NAME.NDPS.PRINTERS.CITY.STATE.CORPORATION

The bold is not variable text.

So, it could be HALL_WAY.NDPS.PRINTERS.CHI.IL.IBM

Perhaps we're going about it the wrong way? What other ways could I get this text file to the printer without using notepad or word?

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

is this printer configured in windows, if it is then u should be able to go to control panel-> printers and see how the path appears for this printer, jsut copy the path from there into the command line and that should work.

if not u could try net view( in DOS) to get the name of the print server, ur jsut gonna have to sort thru all the results

_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Link to comment
Share on other sites

is this printer configured in windows, if it is then u should be able to go to control panel-> printers and see how the path appears for this printer, jsut copy the path from there into the command line and that should work.

if not u could try net view( in DOS) to get the name of the print server, ur jsut gonna have to sort thru all the results

Yes, the printer's configured in Winblows....but it's just not working as described.

I've opened up the printer/fax window and tried copying to the printer name, I've tried copying to the Context, the tech's tried copying to the NDPS printer server IP/printer name, and we've tried using the DOS PRINT /D:DEVICE FILE.TXT

Nothing seems to work on our setup, so I guess I'll just have to deal with it crashing because our network is set up goofy.

FYI, I'm trying to print this directly from VBS without having to open up Word to print it. I could use the AutoItX DLL, but I restricted from making distributable programs with extra DLL files.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...