NET USE LPT1: \\mypc\myusbprinter
Where "mypc" is the name of the PC where I am running the Clipper
application; and "myusbprinter" is the name of the USB printer that
cannot be addressed directly from a DOS application.
This has been discussed here a number of times, and is supposed to
work on W2000.
I have accepted this in good faith, and even documented this on:
http://www.dse.nl/~tmk/clipper/clpwinprint.htm
However, I have now tried this in practice for the first time; and
though it works when the PC is connected to a network, the NET USE
command invariably fails with various error messages if it is used
standalone (error codes 52, 67, 1231). Adding a /persistant option has
no effect.
My question is therefore: has anybody actually ever done this
successfully in real life on a stand-alone PC?
(By the way, I know of the many excellent programs that allow you to
access a USB printer indirectly).
Dick Koster
>One of the ways to print from Clipper to a locally connected USB
>printer is to execute something like the following command first:
>
>NET USE LPT1: \\mypc\myusbprinter
>
>Where "mypc" is the name of the PC where I am running the Clipper
>application; and "myusbprinter" is the name of the USB printer that
>cannot be addressed directly from a DOS application.
>
>This has been discussed here a number of times, and is supposed to
>work on W2000.
>
>I have accepted this in good faith, and even documented this on:
>
>http://www.dse.nl/~tmk/clipper/clpwinprint.htm
>
>However, I have now tried this in practice for the first time; and
>though it works when the PC is connected to a network, the NET USE
>command invariably fails with various error messages if it is used
>standalone (error codes 52, 67, 1231). Adding a /persistant option has
>no effect.
>
>My question is therefore: has anybody actually ever done this
>successfully in real life on a stand-alone PC?
>
All you need is a network device in the PC so that you can load MS
Networking and share the printer. A physical network connection isn't
required.
so why not install network-client on the PC including printer-sharing and -
very important - share the usb-printer!, than it will run. But there is
another problem: Very often people have more than one printer, maybee an
older one is connected to LPT1: and the new laser ist connected via usb. But
actual PCs only have one physical LPT-Port. And Windows is unable to map a
physically not existent printer port into a network-printer.
So printing into a usb-printer in that way is possibly only if you can map
an existing printer port, if you lack LPT2: you cant map it into usb and at
the same time print into lpt1: to another printer. I was very surprised to
find this bug in W2K because I do this (mapping not existing printer ports
to network-printers) for about 13 years without problem if the PC is
connected onto a NetWare-network. So Novell is able to do this since more
than 13 years and M$ until now even seems not to know about.
Klemens
"Dick Koster" <t...@dse.nl> schrieb im Newsbeitrag
news:283ee7e4.02112...@posting.google.com...
I tried this on an /2000 system normally connected to the network (but not
connected at that moment); and an /XP system with Ethernet card that had
never yet been connected to a network. Both failed.
The NET USE succeeded when the /2000 system was connected to the network
again.
Following this I have seen:
- When disconnected again, NET USE shows a Disconnected LPT1.
- A NET USE LPT1 /delete works
- A NET USE LPT1 \\mypc\myprinter fails with error 1231 (network location
could not be reached)
- The command does work when I establish a dial-up connection
So apparently some kind of networking must be active for this to work
Dick
"Nick Ramsay" <ne...@nospam.demon.co.uk> wrote in message
news:jpsntuoogfof7bjrl...@4ax.com...
>One of the ways to print from Clipper to a locally connected USB
>printer is to execute something like the following command first:
>
>NET USE LPT1: \\mypc\myusbprinter
>
>Where "mypc" is the name of the PC where I am running the Clipper
>application; and "myusbprinter" is the name of the USB printer that
>cannot be addressed directly from a DOS application.
Under what name is "myusbprinter" shared? Is it a "well behaved" name?
If you enter "net view \\mypc" on the command line, can you see the
printer's share name in the list?
Klas
-------
klas dot engwall at engwall dot com
Spammers, please use this address :-) mailto:postmaster@[127.0.0.1]
I think it is a well behaved name: NET VIEW shows:
Share name Type Used as Comment
--------------------------------------------
test Print LPT1 wsfsfsfs
Whether my PC is connected to the network or not; if I try to COPY a
file to LPT1 when disconnected, I get the error message:
The network location cannot be reached. For information about network
troubleshooting, see Windows Help.
After reconnecting, the COPY works.
Dick
klas.e...@nospam.please (Klas Engwall) wrote in message news:<3ddc2bc7...@nntpserver.swip.net>...
>I think it is a well behaved name: NET VIEW shows:
>
>Share name Type Used as Comment
>--------------------------------------------
>test Print LPT1 wsfsfsfs
So far it looks good.
>Whether my PC is connected to the network or not; if I try to COPY a
>file to LPT1 when disconnected, I get the error message:
Now you got me disconnected too. Could you repeat that s-l-o-w-l-y,
please <g>? Whether the network cable is plugged in or not and you
copy a file to LPT1 when <disconnected how? physically?>
I don't have a Windows 2000 computer here, but I had access to one
today. I installed a local printer, shared it, NET USEd it and printed
to it with the network cable plugged in, then with the cable
unplugged, and then again with it plugged in. No problems NET USEing
it or printing to it in any of the steps. Am I on a different track
from yours <g>?
> unplugged, and then again with it plugged in. No problems NET USEing
> it or printing to it in any of the steps. Am I on a different track
> from yours <g>?
I think so - he said he was COPYING not printing, sounds like he might have
the spooler turned off.
> >Whether my PC is connected to the network or not; if I try to COPY a
> >file to LPT1 when disconnected, I get the error message:
--
HTH
Steve Quinn
This is what I did:
1. With the network cable plugged in, I NET USEd LPT1
to \\mypc\myprinter
2. COPY <textfile> LPT1 - this works
3. Pulled out the network cable
4. COPY <textfile> LPT1
If I do this very quickly, it still works. If I wait a few seconds,
I get an error message that the network location is unavailable.
5. Plugged in the network cable, the COPY works again.
I am guessing that W2000 somehow decides that it needs to go out to
the network to resolve \\mypc (DNS?). Microsoft has articles
explaining how it resolves names, but this says that W2000 starts out
by checking if the name is itself. However, there are probably a
zillion options that affect this procedure, not to mention service
packs, bugs, and so on....
Dick
klas.e...@nospam.please (Klas Engwall) wrote in message news:<3ddd83f9...@nntpserver.swip.net>...
>1. With the network cable plugged in, I NET USEd LPT1
> to \\mypc\myprinter
>2. COPY <textfile> LPT1 - this works
>3. Pulled out the network cable
>4. COPY <textfile> LPT1
> If I do this very quickly, it still works. If I wait a few seconds,
> I get an error message that the network location is unavailable.
>5. Plugged in the network cable, the COPY works again.
when using NT based os, you need to disable Media sensing,
otherwise all bindings associated with the network interface
are released after unplugging.
modify the registry in admin rights and reboot, works ok.
REGEDIT4
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"DisableDHCPMediaSense"=dword:00000001
-S-
With that registry setting I can NET USE and print as indicated below.
Not sure yet what other effects this will have, I did see that W2000 was
spending some tome during start up trying to set up network connections
But thanks once again
Dick
"Siil" <si...@usa.net> wrote in message
news:1l1ttuo2lm918plv0...@4ax.com...
>> unplugged, and then again with it plugged in. No problems NET USEing
>> it or printing to it in any of the steps. Am I on a different track
>> from yours <g>?
>
>I think so - he said he was COPYING not printing, sounds like he might have
>the spooler turned off.
Ah! I didn't notice the change of direction in the question.
Thanks,
>This is what I did:
>
>1. With the network cable plugged in, I NET USEd LPT1
> to \\mypc\myprinter
>2. COPY <textfile> LPT1 - this works
>3. Pulled out the network cable
>4. COPY <textfile> LPT1
Herewith filed under "How to ask for trouble" <bg>
> If I do this very quickly, it still works. If I wait a few seconds,
> I get an error message that the network location is unavailable.
>5. Plugged in the network cable, the COPY works again.
This is a rather extreme test, isn't it? I am not surprised that the
OS complains when you change its working conditions like that.
Apparently Siil's registry hack solved the problem for you? I'll keep
it for future reference, but my #1 suggestion to my users will still
be "Don't disconnect your computer while you are working with it" <g>
>when using NT based os, you need to disable Media sensing,
>otherwise all bindings associated with the network interface
>are released after unplugging.
>
>modify the registry in admin rights and reboot, works ok.
>
>REGEDIT4
>[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
>"DisableDHCPMediaSense"=3Ddword:00000001
Am I correct in supposing that this only applies to DHCP and not when
using fixed IP addresses?
>Siil,
>
>>when using NT based os, you need to disable Media sensing,
>>otherwise all bindings associated with the network interface
>>are released after unplugging.
>>
>>modify the registry in admin rights and reboot, works ok.
>>
>>REGEDIT4
>>[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
>>"DisableDHCPMediaSense"=3Ddword:00000001
>
>Am I correct in supposing that this only applies to DHCP and not when
>using fixed IP addresses?
>
I would guess so - when I did the test for my earlier reply in the
thread, mine worked because I use fixed IP's on my desktop PC's.
I have a simple rule I like to stick with - if the computer is in a
fixed location, it should have a fixed IP. If it's portable, it
should get its IP via DHCP.
about media sensing, enable/disable & side effects:
http://support.microsoft.com/default.aspx?scid=kb;en-us;239924
http://support.microsoft.com/default.aspx?scid=kb;en-us;241410
http://support.microsoft.com/default.aspx?scid=kb;en-us;254651
http://support.microsoft.com/default.aspx?scid=kb;en-us;242600
-S-
>Am I correct in supposing that this only applies to DHCP and not when
>using fixed IP addresses?
nope, You are not correct.
take a look at previously posted links.
cheers,
-S-
Dick
"Siil" <si...@usa.net> wrote in message
news:tanutu8fnv4hjqeun...@4ax.com...
>>>REGEDIT4
>>>[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
>>>"DisableDHCPMediaSense"=3Ddword:00000001
>>
>>Am I correct in supposing that this only applies to DHCP and not when
>>using fixed IP addresses?
>>
>I would guess so - when I did the test for my earlier reply in the
>thread, mine worked because I use fixed IP's on my desktop PC's.
Was that under Win2K or NT4? I can confirm that under NT4 and with
fixed IP addresses the connection with a locally shared and NET USEd
printer is maintained when the cable is unplugged.
>I have a simple rule I like to stick with - if the computer is in a
>fixed location, it should have a fixed IP. If it's portable, it
>should get its IP via DHCP.
Agreed
>>Am I correct in supposing that this only applies to DHCP and not when
>>using fixed IP addresses?
>
>nope, You are not correct.
Well, since I replied to a message where you said "when using NT based
os, you need to disable Media sensing" I am at least partially correct
<g>. My tests show that under NT4 with fixed IP addresses there is no
need to disable media sensing.
Win2K may be different, but the test I did last Thursday did not
confirm that. I will test again with a different approach, but I can't
do that until the end of the coming week.
>Well, since I replied to a message where you said "when using NT based
>os, you need to disable Media sensing" I am at least partially correct
><g>.
yes, You are correct:-)
what I originally ment by "using NT based os" was
"using NT 3.xx & NT 4 (spX) based os" - w2k & wxp.
as far as I know, nt4+spX does not have Media Sensing at all.
(originally & by design USB support also)
cheers,
-S-
>>Well, since I replied to a message where you said "when using NT based
>>os, you need to disable Media sensing" I am at least partially correct
>><g>.
>
>yes, You are correct:-)
>what I originally ment by "using NT based os" was
>"using NT 3.xx & NT 4 (spX) based os" - w2k & wxp.
OK <g>