Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Newsgroups > Vista General

Vista - Re: DOS program problem

Reply
 
Old 04-18-2007   #1 (permalink)
Dave R.


 
 

Re: DOS program problem


"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?

Regards,

Dave



My System SpecsSystem Spec
Old 04-18-2007   #2 (permalink)
Paul H


 
 

Re: DOS program problem


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
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?

Regards,

Dave


My System SpecsSystem Spec
Old 04-18-2007   #3 (permalink)
Dave R.


 
 

Re: DOS program problem


"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


My System SpecsSystem Spec
Old 04-18-2007   #4 (permalink)
RScotti


 
 

Re: DOS program problem

On Wed, 18 Apr 2007 16:47:52 -0400, "Dave R." <dwragle at drbsystems dot com> wrote:

>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:


I hope this helps you Here's what I did.
Just type CMD in the search box than pin the command prompt to the start menu, than right click on it and run as
administrator.
I have a bat file and it works for me!

Have a good day,
RScotti

remove "nospam" in order to email me.

My System SpecsSystem Spec
Old 04-19-2007   #5 (permalink)
Dave R.


 
 

Re: DOS program problem


"RScotti" <rscotti1@nospam.verizon.net> wrote in message
news:um4d23hjppierp3a5886e2e39l5ke59ask@4ax.com...
> On Wed, 18 Apr 2007 16:47:52 -0400, "Dave R." <dwragle at drbsystems
> dot com> wrote:
>
>>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:

>
> I hope this helps you Here's what I did.
> Just type CMD in the search box than pin the command prompt to the
> start menu, than right click on it and run as
> administrator.


That's how I run the elevated command prompt as well.

> I have a bat file and it works for me!


So, if you run the bat file from an elevated command prompt, it works?
When I ran the commands individually from an elevated command prompt it
didn't work, but I didn't try it in a bat. What's your bat file look
like?

Best regards,

Dave


My System SpecsSystem Spec
Old 04-19-2007   #6 (permalink)
RScotti


 
 

Re: DOS program problem

Hi Dave,
On Thu, 19 Apr 2007 12:26:18 -0400, "Dave R." <dwragle at drbsystems dot com> wrote:

>
>"RScotti" <rscotti1@nospam.verizon.net> wrote in message
>news:um4d23hjppierp3a5886e2e39l5ke59ask@4ax.com...
>> On Wed, 18 Apr 2007 16:47:52 -0400, "Dave R." <dwragle at drbsystems
>> dot com> wrote:
>>
>>>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:

>>
>> I hope this helps you Here's what I did.
>> Just type CMD in the search box than pin the command prompt to the
>> start menu, than right click on it and run as
>> administrator.

>
>That's how I run the elevated command prompt as well.
>
>> I have a bat file and it works for me!

>
>So, if you run the bat file from an elevated command prompt, it works?

Yes it does work fine.
>When I ran the commands individually from an elevated command prompt it
>didn't work, but I didn't try it in a bat. What's your bat file look
>like?

Here it is:
>@echo off
>xcopy /s /y /d /h /c "C:\users\rls\Agent" "G:\Agent\"
>xcopy /s /y /d /h /c "C:\users\rls\Agent" "D:\Agent\"
>xcopy /s /y /d /h /c "C:\users\rls\Agent XP" "F:\Agent XP\"
>xcopy /s /y /d /h /c "C:\users\rls\Agent XP" "D:\Agent XP\"
>xcopy /s /y /d /h /c "C:\users\rls\Agent" "M:\Agent\"
>xcopy /s /y /d /h /c "C:\Users\rls\Documents" "G:\Documents\"
>xcopy /s /y /d /h /c "C:\Users\rls\Documents" "D:\Documents\"
>xcopy /s /y /d /h /c "C:\Users\rls\Downloads" "G:\Downloads\"
>xcopy /s /y /d /h /c "C:\Users\rls\Downloads" "D:\Downloads\"
>xcopy /s /y /d /h /c "C:\USERS\RLS\Pictures" "G:\Pictures\"
>xcopy /s /y /d /h /c "C:\USERS\RLS\Pictures" "D:\Pictures\"
>xcopy /s /y /d /h /c "C:\Users\rls\Favorites" "G:\Favorites\"
>xcopy /s /y /d /h /c "C:\Users\rls\Favorites" "D:\Favorites\"
>xcopy /s /y /d /h /c "C:\Users\rls\Backup" "G:\Backup\"
>xcopy /s /y /d /h /c "C:\Users\rls\Backup" "D:\Backup\"
>xcopy /s /y /d /h /c "C:\Users\rls\Backup" "G:\ABackup\"
>xcopy /s /y /d /h /c "C:\Users\rls\Setup" "G:\Setup\"
>xcopy /s /y /d /h /c "C:\Users\rls\Setup" "D:\Setup\"
>xcopy /s /y /d /h /c "C:\Users\rls\Setup" "G:\ABackup\"





>Best regards,
>
>Dave
>


Have a good day,
RScotti

remove "nospam" in order to email me.

My System SpecsSystem Spec
Old 04-20-2007   #7 (permalink)
Dave R.


 
 

Re: DOS program problem


"RScotti" <rscotti1@nospam.verizon.net> wrote in message
news:dgjf23p9vblv1klcnp1t7nsdrqn1qrf0k5@4ax.com...
> Hi Dave,
> On Thu, 19 Apr 2007 12:26:18 -0400, "Dave R." <dwragle at drbsystems
> dot com> wrote:
>
>>
>>"RScotti" <rscotti1@nospam.verizon.net> wrote in message
>>news:um4d23hjppierp3a5886e2e39l5ke59ask@4ax.com...
>>> On Wed, 18 Apr 2007 16:47:52 -0400, "Dave R." <dwragle at drbsystems
>>> dot com> wrote:
>>>
>>>>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:
>>>
>>> I hope this helps you Here's what I did.
>>> Just type CMD in the search box than pin the command prompt to the
>>> start menu, than right click on it and run as
>>> administrator.

>>
>>That's how I run the elevated command prompt as well.
>>
>>> I have a bat file and it works for me!

>>
>>So, if you run the bat file from an elevated command prompt, it works?

> Yes it does work fine.
>>When I ran the commands individually from an elevated command prompt
>>it
>>didn't work, but I didn't try it in a bat. What's your bat file look
>>like?

> Here it is:
>>@echo off
>>xcopy /s /y /d /h /c "C:\users\rls\Agent" "G:\Agent\"
>>xcopy /s /y /d /h /c "C:\users\rls\Agent" "D:\Agent\"
>>xcopy /s /y /d /h /c "C:\users\rls\Agent XP" "F:\Agent XP\"
>>xcopy /s /y /d /h /c "C:\users\rls\Agent XP" "D:\Agent XP\"
>>xcopy /s /y /d /h /c "C:\users\rls\Agent" "M:\Agent\"
>>xcopy /s /y /d /h /c "C:\Users\rls\Documents" "G:\Documents\"
>>xcopy /s /y /d /h /c "C:\Users\rls\Documents" "D:\Documents\"
>>xcopy /s /y /d /h /c "C:\Users\rls\Downloads" "G:\Downloads\"
>>xcopy /s /y /d /h /c "C:\Users\rls\Downloads" "D:\Downloads\"
>>xcopy /s /y /d /h /c "C:\USERS\RLS\Pictures" "G:\Pictures\"
>>xcopy /s /y /d /h /c "C:\USERS\RLS\Pictures" "D:\Pictures\"
>>xcopy /s /y /d /h /c "C:\Users\rls\Favorites" "G:\Favorites\"
>>xcopy /s /y /d /h /c "C:\Users\rls\Favorites" "D:\Favorites\"
>>xcopy /s /y /d /h /c "C:\Users\rls\Backup" "G:\Backup\"
>>xcopy /s /y /d /h /c "C:\Users\rls\Backup" "D:\Backup\"
>>xcopy /s /y /d /h /c "C:\Users\rls\Backup" "G:\ABackup\"
>>xcopy /s /y /d /h /c "C:\Users\rls\Setup" "G:\Setup\"
>>xcopy /s /y /d /h /c "C:\Users\rls\Setup" "D:\Setup\"
>>xcopy /s /y /d /h /c "C:\Users\rls\Setup" "G:\ABackup\"

>


Oh, well, that's completely different. We were talking about
redirecting the LPT1: port to a printer configured to print to the FILE:
device and being able to print to it from a DOS program / CMD prompt and
have it ask for the file name. Thanks anyway, though.

Regards,

Dave


My System SpecsSystem Spec
Old 04-20-2007   #8 (permalink)
RScotti


 
 

Re: DOS program problem

>>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,

This is all I was trying to answer for you. Just show you how to run the elevated CMD with a batch file.

On Fri, 20 Apr 2007 07:39:50 -0400, "Dave R." <dwragle at drbsystems dot com> wrote:

>
>"RScotti" <rscotti1@nospam.verizon.net> wrote in message
>news:dgjf23p9vblv1klcnp1t7nsdrqn1qrf0k5@4ax.com...
>> Hi Dave,
>> On Thu, 19 Apr 2007 12:26:18 -0400, "Dave R." <dwragle at drbsystems
>> dot com> wrote:
>>
>>>
>>>"RScotti" <rscotti1@nospam.verizon.net> wrote in message
>>>news:um4d23hjppierp3a5886e2e39l5ke59ask@4ax.com...
>>>> On Wed, 18 Apr 2007 16:47:52 -0400, "Dave R." <dwragle at drbsystems
>>>> dot com> wrote:
>>>>
>>>>>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:
>>>>
>>>> I hope this helps you Here's what I did.
>>>> Just type CMD in the search box than pin the command prompt to the
>>>> start menu, than right click on it and run as
>>>> administrator.
>>>
>>>That's how I run the elevated command prompt as well.
>>>
>>>> I have a bat file and it works for me!
>>>
>>>So, if you run the bat file from an elevated command prompt, it works?

>> Yes it does work fine.
>>>When I ran the commands individually from an elevated command prompt
>>>it
>>>didn't work, but I didn't try it in a bat. What's your bat file look
>>>like?

>> Here it is:
>>>@echo off
>>>xcopy /s /y /d /h /c "C:\users\rls\Agent" "G:\Agent\"
>>>xcopy /s /y /d /h /c "C:\users\rls\Agent" "D:\Agent\"
>>>xcopy /s /y /d /h /c "C:\users\rls\Agent XP" "F:\Agent XP\"
>>>xcopy /s /y /d /h /c "C:\users\rls\Agent XP" "D:\Agent XP\"
>>>xcopy /s /y /d /h /c "C:\users\rls\Agent" "M:\Agent\"
>>>xcopy /s /y /d /h /c "C:\Users\rls\Documents" "G:\Documents\"
>>>xcopy /s /y /d /h /c "C:\Users\rls\Documents" "D:\Documents\"
>>>xcopy /s /y /d /h /c "C:\Users\rls\Downloads" "G:\Downloads\"
>>>xcopy /s /y /d /h /c "C:\Users\rls\Downloads" "D:\Downloads\"
>>>xcopy /s /y /d /h /c "C:\USERS\RLS\Pictures" "G:\Pictures\"
>>>xcopy /s /y /d /h /c "C:\USERS\RLS\Pictures" "D:\Pictures\"
>>>xcopy /s /y /d /h /c "C:\Users\rls\Favorites" "G:\Favorites\"
>>>xcopy /s /y /d /h /c "C:\Users\rls\Favorites" "D:\Favorites\"
>>>xcopy /s /y /d /h /c "C:\Users\rls\Backup" "G:\Backup\"
>>>xcopy /s /y /d /h /c "C:\Users\rls\Backup" "D:\Backup\"
>>>xcopy /s /y /d /h /c "C:\Users\rls\Backup" "G:\ABackup\"
>>>xcopy /s /y /d /h /c "C:\Users\rls\Setup" "G:\Setup\"
>>>xcopy /s /y /d /h /c "C:\Users\rls\Setup" "D:\Setup\"
>>>xcopy /s /y /d /h /c "C:\Users\rls\Setup" "G:\ABackup\"

>>

>
>Oh, well, that's completely different. We were talking about
>redirecting the LPT1: port to a printer configured to print to the FILE:
>device and being able to print to it from a DOS program / CMD prompt and
>have it ask for the file name. Thanks anyway, though.
>
>Regards,
>
>Dave
>


Have a good day,
RScotti

remove "nospam" in order to email me.

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Problem with OC program Overclocking & Cooling
Program Loading Problem. Vista General
Program Problem/Drivers Vista hardware & devices
program uninstall problem Vista performance & maintenance
UAC with a specific program problem Vista account administration


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46