"Paul H" <NoSpamphobergNoSpam@att.net> wrote in message
news:E361A0C1-A9D8-4955-968E-A86EB9A2D61C@microsoft.com...
>
> "Dave R." <dwragle at drbsystems dot com> wrote in message
> news:46263331$0$97254$892e7fe2@authen.yellow.readfreenews.net...
>
>> "Paul H" <NoSpamphobergNoSpam@att.net> wrote in message
>> news:6774063A-AA98-48BB-B838-F0F7E7531015@microsoft.com...
>>> 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?
>
> 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
> ===========================
>
No problem, Paul. I figured I'd eventually have to see if I could get
it to work so there was no time like the present
Anyway, the elevated command prompt just means I ran cmd.exe as an
administrator, so that's not something you can do inside of a batch file
as far as I know. Until someone has any other ideas, the only thing
I've seen that might help was from a post over in the networking_sharing
group from Davide Guolo:
> you may want to have a look at Printfil to capture the DOS LPT1:
> output and
> forward it to any printer installed on your Vista machine (including
> GDI and
> virtual printers)
>
> You can find more info and a free trial version to download at
> http://www.printfil.com
I've not tried it, so I don't know if it will do what you need but it
may be worth a try.
Regards,
Dave