NET USE error when printing with NT (AREV Specific)
At 20 FEB 2001 07:00:36AM Ian Lord wrote:
Hello all,
Maybe i am doing something very wrong but here goes..
I am primarily using a pcperform to execute a copy to lpt1,lpt2,lpt3. This works fantastic on Novell, capture the printer use,
PCPERFORM "COPY MYFILE LPTx /B" ←- no problem, Novell great.
However,
this route is not great for NT, i keep on getting DOS errors when creating an NT map to a specific LPT device for a shared printer.
Therefore, went this routine which worked well as a test subroutine.
PCPERFORM "NET USE LPT3:\\COMPUTER NAME\SHARED PRINTER"
PCPERFORM "COPY MYFILE LPT3 /B"
PCPERFORM "NET USE LPT3:/DELETE"
This works great, for a while, i then get sytem error 67 or system error 85 (means the port is captured, NT's way to say no way). I also get a write fault error to the device. From this i am presuming the device is not captured and that the port is not recognised by DOS.
So here is the question. What is wrong it works sometimes?? not others?? can Arev ever print to a shared device without Novell, if it can how is it done.
I simply want to be able to print to a shared NT printer with a nice simple command like COPY as the report has been created as a .PRN file so a copy to the device is cool.
so all i can say is please help as this is infuriating.
At 20 FEB 2001 08:43AM Don Miller - C3 Inc. wrote:
Try the PERSISTENT flag on the NET USE command line. The complete syntax for this command can be found by typing NET USE /?.
Don Miller
C3 Inc.
At 20 FEB 2001 01:14PM Jim Jefferson wrote:
We have exactly the same problem, but have been living with it.
Will "persistent" take care of this, as we do a whole series of "net use, copy, net use delete" sequences to get a single PRN file to print on a number of network shared printers? It seems to work fine for a short while, but we hit some sort of limit or timing problem.
And, we always want to use the "delete" option last so the other Windows programs can print to local printers (when they have them). I'm guessing that "delete" will remove a "persistent" setting; I'll have to try this out.
At 20 FEB 2001 03:47PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Assuming the print device is configured correctly within the operating system, and that all cables are ok, and no third party spoolers, other than the driver from the printer vendor,
PCPERFORM each of the following in sequence:
"NET USE LPT3:/DELETE"
"NET USE LPT3:\\COMPUTER NAME\SHARED PRINTER /PERSISTENT:YES"
"COPY MYFILE LPT3 /B"
"NET USE LPT3:/DELETE"
There are advantages to only assigning the print device for the minimum period, and to unassigning ahead of assigning it. Any error on an unassign is benign. You might also consider running these commands from a batch file which accepts a parameter (your filename).
World Leaders in all things RevSoft
At 21 FEB 2001 08:18AM Ian Lord wrote:
At 21 FEB 2001 01:47PM Ian Lord wrote:
Have tried the adivce and you really do need a delete before defining the port. But i have had to do some modifications.
It is easy and i have stress tested it with 2000 continuous documents to see if it died, it is still going.
But and it is a big but !!
The problem was over come by making a .BAT file where all the DOS commands are placed and the only passed variable is the MYFILE.
So simple BAT
——– Bat code
@Echo off
Echo Printing file %1
net use lpt2 /delete
net use lpt2 \\Computer\Shared Printer /persistent:yes
COPY %1 lpt2 /b
net use lpt2 /delete
—– that is the bat file
when calling DO NOT CALL BY BUILDING THE PCPERFORM..
Build a string if the path first
txt=bat location:' ':myfile
pcperfrom txt
this works all else dies….
you will need to make a bat file for each shared printer, sorry about the extra work but this method works for me where all else has died and very spectacular too.. This now means i can have a mash of Novell captures and NT shared printers… At last printing…
I hope this sorts out your problem, it has made my life smoother..
At 21 FEB 2001 01:47PM Ian Lord wrote:
Have tried the adivce and you really do need a delete before defining the port. But i have had to do some modifications.
It is easy and i have stress tested it with 2000 continuous documents to see if it died, it is still going.
But and it is a big but !!
The problem was over come by making a .BAT file where all the DOS commands are placed and the only passed variable is the MYFILE.
So simple BAT
——– Bat code
@Echo off
Echo Printing file %1
net use lpt2 /delete
net use lpt2 \\Computer\Shared Printer /persistent:yes
COPY %1 lpt2 /b
net use lpt2 /delete
—– that is the bat file
when calling DO NOT CALL BY BUILDING THE PCPERFORM..
Build a string if the path first
txt=bat location:' ':myfile
pcperfrom txt
this works all else dies….
you will need to make a bat file for each shared printer, sorry about the extra work but this method works for me where all else has died and very spectacular too.. This now means i can have a mash of Novell captures and NT shared printers… At last printing…
I hope this sorts out your problem, it has made my life smoother..
At 21 FEB 2001 01:47PM Ian Lord wrote:
Have tried the adivce and you really do need a delete before defining the port. But i have had to do some modifications.
It is easy and i have stress tested it with 2000 continuous documents to see if it died, it is still going.
But and it is a big but !!
The problem was over come by making a .BAT file where all the DOS commands are placed and the only passed variable is the MYFILE.
So simple BAT
——– Bat code
@Echo off
Echo Printing file %1
net use lpt2 /delete
net use lpt2 \\Computer\Shared Printer /persistent:yes
COPY %1 lpt2 /b
net use lpt2 /delete
—– that is the bat file
when calling DO NOT CALL BY BUILDING THE PCPERFORM..
Build a string if the path first
txt=bat location:' ':myfile
pcperfrom txt
this works all else dies….
you will need to make a bat file for each shared printer, sorry about the extra work but this method works for me where all else has died and very spectacular too.. This now means i can have a mash of Novell captures and NT shared printers… At last printing…
I hope this sorts out your problem, it has made my life smoother..