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-08-10 06:55
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to call batch commands to implement the print function in the right-click of Word? View 2,566 Replies 23
Original Poster Posted 2008-11-02 19:24 ·  中国 江西 南昌 电信
社区乞丐
Credits -16
Posts 11
Joined 2008-11-02 11:14
17-year member
UID 129751
Gender Male
Status Offline
Our company is currently working on a project, and a function needs to be implemented in the project as described below:

I installed a software that can convert various format documents into GIF image format, such as converting .doc, .txt, .pdf, .ppt, etc. When the mouse selects a certain file, there is a print option in the right-click menu. The system needs to use DOS commands to select a certain file and call the print function in the right-click menu. How should this be done?


───────────────── Moderation Record ─────────────────
Performed: HAT
Operation: Added search keywords in the post title
Description: The original title "A Problem That Even a Company of 20 People Can't Solve" is not conducive to forum search
Punishment: Since it is a new forum user, no point punishment is given
Tip: It is recommended to read the following posts
{1415}The Wisdom of Asking Questions
{7326}Must-read for Forum Newcomers, Basic Code of Conduct for Everyone
{22703}Please Don't Be an Impatient Person
{32667}Those Who Can't Even Write a Clear Title, Wake Up
{32825}This Board Severely Rectifies Poor Posts
───────────────── Moderation Record ─────────────────


[ Last edited by HAT on 2008-11-2 at 20:08 ]
Floor 2 Posted 2008-11-02 19:40 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
C:\Documents and Settings\Administrator>print /?
Print a text file.

PRINT [/D:device] [[drive:][path]filename[...]]

/D:device Specify the printer device.

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 3 Posted 2008-11-02 21:00 ·  中国 江西 南昌 电信
社区乞丐
Credits -16
Posts 11
Joined 2008-11-02 11:14
17-year member
UID 129751
Gender Male
Status Offline
It seems not right. I've tried. The key is that I don't know how to write /d:device. Is it the printer name or the port name?
Floor 4 Posted 2008-11-02 21:40 ·  中国 广东 广州 天河区 电信
高级用户
★★★
潜水修练批处理
Credits 788
Posts 366
Joined 2006-12-31 02:43
19-year member
UID 75048
Gender Male
Status Offline
Example
To send Report.txt in the current directory to LPT2 connected to the local computer, type:

print /d:LPT2 report.txt

To send the Report.txt file in the c:\Accounting directory to the Printer1 print queue on the server \\CopyRoom, type:

print /d:\\copyroom\printer1 c:\accounting\report.txt


Detailed operation hh.exe C:\WINDOWS\Help\ntcmds.chm::/print.htm
正在潜水修练的批处理小白
Floor 5 Posted 2008-11-02 21:46 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
I haven't used this command to print anything before, but the device should be filled with the printer command

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 6 Posted 2008-11-02 21:55 ·  中国 江西 南昌 电信
社区乞丐
Credits -16
Posts 11
Joined 2008-11-02 11:14
17-year member
UID 129751
Gender Male
Status Offline
Originally posted by dikex at 2008-11-2 21:40:
**Example**
To send Report.txt in the current directory to LPT2 connected to the local computer, type:

print /d:LPT2 report.txt

To send the Report.txt file in the c:\Accounting directory to ...



Did as above, my port name is img_00

Typing print /d:img_00 a.txt prompts that the img_00 device cannot be initialized
Floor 7 Posted 2008-11-02 22:14 ·  中国 江西 南昌 电信
社区乞丐
Credits -16
Posts 11
Joined 2008-11-02 11:14
17-year member
UID 129751
Gender Male
Status Offline
How to use such command parameters
Floor 8 Posted 2008-11-02 22:17 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
No translation needed as the text is in Chinese but the user just provided that sentence and the instruction is to translate from Chinese to English if not already, but this is already in Chinese. Wait, no, wait. Wait the original input is "家里没打印机,不知道怎么测试,楼主要是解决了这问题,可要上来发贴说一下怎么解决的" which needs to be translated to English.

Translation: There is no printer at home, I don't know how to test. If the landlord solves this problem, he must come up and post to say how to solve it.

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 9 Posted 2008-11-02 22:46 ·  中国 广东 广州 天河区 电信
高级用户
★★★
潜水修练批处理
Credits 788
Posts 366
Joined 2006-12-31 02:43
19-year member
UID 75048
Gender Male
Status Offline
Let's see if this is the case:
http://support.microsoft.com/kb/131470/zh-cn
正在潜水修练的批处理小白
Floor 10 Posted 2008-11-02 23:41 ·  中国 江西 南昌 电信
社区乞丐
Credits -16
Posts 11
Joined 2008-11-02 11:14
17-year member
UID 129751
Gender Male
Status Offline
"D:\Microsoft Office\Office12\WINWORD.EXE" /x /n /dde
[REM _DDE_Minimize][FileOpen("%1")][t=IsDocumentDirty()][FilePrint 0][SetDocumentDirty t][DocClose]

I don't know how to write the key parameters. If you give a complete example with parameters, I will be able to end this thread.
My writing is "D:\Microsoft Office\Office12\WINWORD.EXE" /x /n /dde
fileipen("e:\a.doc") fileprint 0 but there is no result
Floor 11 Posted 2008-11-02 23:59 ·  中国 广东 广州 天河区 电信
高级用户
★★★
潜水修练批处理
Credits 788
Posts 366
Joined 2006-12-31 02:43
19-year member
UID 75048
Gender Male
Status Offline
Found somewhere, using the macro
"C:\......\WINWORD.EXE" "d:\......\a.doc" /mFilePrintDefault
正在潜水修练的批处理小白
Floor 12 Posted 2008-11-03 10:43 ·  中国 江西 南昌 电信
社区乞丐
Credits -16
Posts 11
Joined 2008-11-02 11:14
17-year member
UID 129751
Gender Male
Status Offline
The problem is like this: To use batch commands to realize the print function of right - click in Word, and the way to realize the right - click print function in PowerPoint is like this:

"D:\Microsoft Office\Office12\POWERPNT.EXE" /p "e:\a.ppt"


The same method is not effective for Word documents. How should it be done?

(Note: You can test without installing a printer because printing just converts the document into an image)

───────────────── Moderation Record ──────────────────
Execution: HAT
Operation: Add search keywords in the post title; add code tags to the code
Explanation: The original title "A problem that stumps many, many people, need your final solution" is not conducive to forum search
Punishment: Deduct 2 points of points
Tip: It is suggested to read the following posts
{1415}The Wisdom of Asking Questions
{7326}Essential Read for Forum Newcomers, Basic Code of Conduct for Everyone
{22703}Please Don't Be an Impatient Person
{32667}Those People Who Can't Even Write a Clear Title, Wake Up
{32825}This Forum Severely Rectifies Poor - Quality Posts
───────────────── Moderation Record ──────────────────


[ Last edited by HAT on 2008 - 11 - 3 at 16:12 ]
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
HAT -2 2008-11-03 16:12
Floor 13 Posted 2008-11-03 10:50 ·  中国 江西 赣州 电信
初级用户
Credits 80
Posts 45
Joined 2006-09-22 22:28
19-year member
UID 63398
Gender Male
From jiangxi
Status Offline
DOS Batch Processing & Scripting Technology (Batch Processing Room)
Floor 14 Posted 2008-11-03 13:07 ·  中国 江西 南昌 电信
社区乞丐
Credits -16
Posts 11
Joined 2008-11-02 11:14
17-year member
UID 129751
Gender Male
Status Offline
The problem is like this: To use batch commands to implement the print function in the right-click of Word, and for PowerPoint to implement the right-click print function is like this, "D:\Microsoft Office\Office12\POWERPNT.EXE" /p "e:\a.ppt". The same method for Word documents doesn't work. How to do it? (Note that you don't need to install a printer to test, because printing just converts the document into an image) "D:\Microsoft Office\Office12\WINWORD.EXE" /p "e:/a.doc" doesn't work
Floor 15 Posted 2008-11-03 14:36 ·  中国 福建 三明 电信
中级用户
★★
Credits 458
Posts 211
Joined 2006-07-26 19:42
20-year member
UID 59307
Status Offline
Write what software you installed
Post a picture of your right-click menu
Find the corresponding value in the registry (if any) (no one will help you if you don't)

======================
Will be helpful to people answering questions
┌───────┐
├→学习→实践→┤
└───────┘
Forum Jump: