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-05 13:56
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to automatically close the CMD window after opening a file View 2,272 Replies 3
Original Poster Posted 2007-08-01 15:26 ·  中国 云南 昆明 教育网
新手上路
Credits 6
Posts 2
Joined 2007-07-31 20:22
19-year member
UID 94392
Gender Male
Status Offline
I want to open a PDF file and automatically jump to a certain page. The function has been implemented, but every time a cmd window always pops up and must be closed until the PDF file is closed. The code is as follows:

a.bat
==========================
AcrPDF.bat 11
==========================

AcrPDF.bat
==========================
"D:\Program Files\Adobe\Acrobat 7.0\Acrobat\Acrobat.exe" /A "page=%1=OpenActions" "E:\Temp\Binder1.pdf"
==========================

How can I make the cmd window automatically close after opening the PDF file?
Using commands like start, cmd /c, etc. doesn't work

[ Last edited by bjsh on 2007-8-2 at 11:41 PM ]
Floor 2 Posted 2007-08-01 15:37 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 1,928
Posts 931
Joined 2007-01-06 11:46
19-year member
UID 75624
Gender Male
Status Offline
Can't we just use one bat file? Why two?

set /p num=请输入页数:
start "D:\Program Files\Adobe\Acrobat 7.0\Acrobat\Acrobat.exe" /A "page=%num%=OpenActions" "E:\Temp\Binder1.pdf"


Is this okay?
Floor 3 Posted 2007-08-01 15:41 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
I use Foxit Reader.exe
Code
start "" "D:\Text\Foxit Reader.exe" "d:\Office\Wonders of Office Software.pdf" /n 55
Can open page 55. Haven't used Acrobat, don't know the reason.

[ Last edited by ccwan on 2007-8-1 at 03:47 PM ]
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 4 Posted 2007-08-01 16:16 ·  中国 云南 昆明 教育网
新手上路
Credits 6
Posts 2
Joined 2007-07-31 20:22
19-year member
UID 94392
Gender Male
Status Offline
Thanks to the person above, putting start in the second .bat worked.

Originally posted by wudixin96 at 2007-8-1 15:37:
Can't you just use one bat file?

Why two?

I combined many papers, and of course I can't remember which page each article corresponds to, so I use each .bat file to record and pass parameters.
Forum Jump: