Dave, first let me thank you for the non-trivial effort you expended. I
tried "NET USE LPT1: \\Paulsacerlaptop\Brother HL-5140" and got error 1326 -
"Logon failure: unknown user name or bad password". I don't know what an
elevated command prompt is, or how to invoke it as part of my batch file.
In this case, printing directly to the printer, not to a text file, is
acceptable, although I have other instances where the ability to print to a
file is crucial. Thx, Paul
===========================
"Dave R." <dwragle at drbsystems dot com> wrote in message
Paul H said:
I use a DOS program that I wrote years ago by using this 2 line .BAT
file
on my XP Pro laptop. When my program writes to LPT1: I get a small
window
that asks me to enter a file name to write to.
NET USE LPT1: \\Pc296673087013\Textfile
C:\util\LOAN.COM
Changing the computer name to my Vista Home Premium's name, then using
it on
my new Vista laptop, causes an error 66, followed by "The network
resource
type is not correct." But the program does run correctly in a DOS
window -
it just won't print. How can I make the printer work? TIA, Paul
I've used a similar approach under Windows 2000 and XP, so I gave it a
try to see if I could make it work in Vista. Ultimately, I couldn't get
it to work properly

.
Here's what I did:
Added a new local printer configured for the "port" called File: (Print
to File), using the Generic / Text Only driver.
Tested by printing from Notepad, it prompted for a file name and worked
fine.
Set the printer to Shared and gave Everyone full permissions. (As an
aside, Vista wouldn't let me turn on printer sharing in the network and
sharing center because it claimed I didn't have a printer attached. I
had to physically attach and configure a real printer before I could
enable printer sharing...)
Started a command prompt and tried the NET USE LPT1:
\\mycomputername\myprintername and got told that the password was
invalid for \\mycomputername\myprintername and was prompted for a
username and password for mycomputername.
Supplying a standard account user name and password failed with a system
error 5 has occurred, access is denied.
Supplying an administrator account username and password failed with the
same error.
Tried again from an elevated command prompt, and the net use command
completed successfully.
Tested by trying "echo blah>LPT1:" from both a standard and an elevated
command prompt but never got a dialog asking for the file name like I do
under XP.
Checked the print queue, and showed two documents called "Local
Downlevel Document". The first had a status of "Error - Printing" and a
port of FILE:
Deleted the print jobs from the queue, and ran "NET USE LPT1: /DELETE"
to remove the port redirection.
Ran "NET USE LPT1: \\mycomputername\myotherprintername" from an elevated
command prompt to see if the problem was with redirecting LPT1 or with
the FILE printer type.
Ran "echo blah>LPT1:" again, and it worked.
It looks like the problem is with redirecting another device to the FILE
device. I've no idea what else to try, but as far as I can tell it's
just broken in Vista.
Does anyone else have any ideas?
Regards,
Dave