China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-29 06:41
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » To print an ACAD PLT file, how to obtain the location of the network printer? View 1,645 Replies 2
Original Poster Posted 2005-09-22 21:31 ·  中国 湖北 武汉 电信
新手上路
Credits 18
Posts 10
Joined 2005-09-16 16:47
20-year member
UID 42563
Status Offline
It's quite challenging, involving network, programming, DOS, Windows, hope experts can give more guidance...

Network situation:
Within the local area network, there is a data server, on which there is an HP printer, and there is another printer in the network (this printer has an IP address, and the network cable is directly connected to it).

My process:
Use VC to give the user an interface, let the user select the plt file to be printed, and I get the path.
First map the folder of the data server to the local z:
net use z: \\server\data

Then copy z:\*.plt \\computer name\printer name



Problem:
1. I need to type copy *.plt \\computer name\printer name under DOS. But how can I make the user not care about this under Windows (because the HP printer is the default printer in the control panel), and how does my program know the location of the printer (\\computer name\printer name)? Can this be done?
Or like this: give the user an interface to select the printer, and get the printer address from it. How to write this...

2. For the network printer with an IP address (don't know how to call it, this printer is directly connected to the network and has an IP address), how should I print the plt file? Is the method of copy *.plt \\computer name feasible? And how to get this IP address...
Floor 2 Posted 2005-09-23 15:25 ·  中国 湖北 武汉 电信
新手上路
Credits 18
Posts 10
Joined 2005-09-16 16:47
20-year member
UID 42563
Status Offline
The first one has been solved. The key is the second one: How does this computer use the separate IP address on the LAN to print PLT files directly with a network - cable - connected printer... How to write this Copy command...
Floor 3 Posted 2005-09-26 09:28 ·  中国 湖北 武汉 电信
新手上路
Credits 18
Posts 10
Joined 2005-09-16 16:47
20-year member
UID 42563
Status Offline
For a print server with a fixed IP address, other users can choose to install a local printer during installation, select the TCP/IP port, and enter that IP address.

For the above - mentioned printer:
1. Other users install it as a local printer (named hp 5000) and share it (with the share name hp), and they can use copy *.plt \\127.0.0.1\hp to print.
2. If it is not shared, they cannot use copy *.plt \\127.0.0.1\hp 5000 to print, and a syntax error is prompted (it seems that spaces are not supported).
3. Modify hp 5000 to hp5000, and using copy *.plt \\127.0.0.1\hp5000 cannot print...

Question: Can anyone explain the reasons for success and failure in the above 3 tests? Why must it be shared to be used?? (I added it as a local printer...)
Forum Jump: