|
flying008
中级用户
  
积分 245
发帖 103
注册 2006-6-30
状态 离线
|
『第 16 楼』:
使用 LLM 解释/回答一下
偶想用批处理调用一个程序adobe reader 7.0,这是看PDF文档的软件,相信很多人用到,路径是"D:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe",现在想用批处理文件启动这个程序后,批处理窗口自动关闭,而 adobe reader 7.0还在运行。偶只能做到批处理启动这个程序,但窗口不能自动 关闭,只要程序还在运行,命令行窗口就还存在,哪位可以实现启动这个程序后自动关闭命令行窗口这样的功能?
注意:要试验后才能发言哟……谢谢……
I want to use a batch script to call a program Adobe Reader 7.0, which is a software for viewing PDF documents, and I believe many people use it. The path is "D:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe". Now I want to use a batch file to start this program and then have the batch window close automatically while Adobe Reader 7.0 is still running. I can only start this program with the batch, but the window can't close automatically. As long as the program is running, the command line window is still there. Who can achieve the function of closing the command line window automatically after starting this program? Note: Please speak after testing... Thank you...
|
|
2006-7-21 09:06 |
|
|
namejm
荣誉版主
       batch fan
积分 5226
发帖 1737
注册 2006-3-10 来自 成都
状态 离线
|
『第 17 楼』:
使用 LLM 解释/回答一下
楼上的,把你的代码贴出来看看再说。
The person upstairs, post your code and then we'll talk.
|
|
2006-7-21 10:27 |
|
|
flying008
中级用户
  
积分 245
发帖 103
注册 2006-6-30
状态 离线
|
『第 18 楼』:
使用 LLM 解释/回答一下
=======
@echo off
"D:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe"
exit
=======
还只有这样才能在批处理中启动程序,其它如START或不要引号等方式都不行。请namejm指教……谢谢……
=======
@echo off
"D:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe"
exit
=======
Only in this way can a program be started in a batch file. Other methods such as START or without quotes don't work. Please namejm give advice... Thanks...
|
|
2006-7-21 10:37 |
|
|
flying008
中级用户
  
积分 245
发帖 103
注册 2006-6-30
状态 离线
|
『第 19 楼』:
使用 LLM 解释/回答一下
声明……由于某种原因,最好不用cd /d 或pushd popd这切换当前目录的方式的,
Statement... For some reason, it's better not to use methods like cd /d or pushd popd to switch the current directory.
|
|
2006-7-21 10:38 |
|
|
zh159
金牌会员
     
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第 20 楼』:
使用 LLM 解释/回答一下
先设置可执行文件的搜索路径再 start。
%ProgramFiles%=系统盘的 Program Files 目录
@echo off
path=%path%;%ProgramFiles%\Adobe\Acrobat 6.0\Reader\
start AcroRd32.exe
exit
Last edited by zxcv on 2006-7-21 at 13:11 ]
First set the search path for executable files and then start.
%ProgramFiles% = Program Files directory of the system drive
@echo off
path=%path%;%ProgramFiles%\Adobe\Acrobat 6.0\Reader\
start AcroRd32.exe
exit
Last edited by zxcv on 2006-7-21 at 13:11 ]
|
|
2006-7-21 11:30 |
|
|
flying008
中级用户
  
积分 245
发帖 103
注册 2006-6-30
状态 离线
|
『第 21 楼』:
使用 LLM 解释/回答一下
20楼的解法甚是OK,呵呵……
顺便弱弱的问一句,这个PATH设置的路径只对一行start语句有效吧?因为偶在start AcroRd32.exe的下面加了一句 start ABC.exe[这个ABC是批处理的当前目录下的程序],同样也运行起来了……就是说PATH设置的路径不会影响从第一个START开始的第二行和以下的语句吧?
thanks
Last edited by flying008 on 2006-7-21 at 13:01 ]
The solution on floor 20 is quite OK, heh heh...
By the way, I timidly ask a question: Does this PATH - set path only work for one line of the start statement? Because I added a line start ABC.exe below start AcroRd32.exe, and it also ran. That is to say, the PATH - set path won't affect the second and following statements from the first START?
thanks
Last edited by flying008 on 2006 - 7 - 21 at 13:01 ]
|
|
2006-7-21 12:57 |
|
|
zh159
金牌会员
     
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第 22 楼』:
使用 LLM 解释/回答一下
不会
path只是指明可以到该路径内搜索要执行的文件
更改一下不影响系统默认的设置路径
path=%path%;%ProgramFiles%\Adobe\Acrobat 6.0\Reader\
否则系统原来默认的设置路径里的软件有可能无法执行
Last edited by zxcv on 2006-7-21 at 13:14 ]
won't
path only indicates that the files to be executed can be searched within this path
Changing it will not affect the system's default set path
path=%path%;%ProgramFiles%\Adobe\Acrobat 6.0\Reader\
Otherwise, the software in the original default set path of the system may not be executable
Last edited by zxcv on 2006-7-21 at 13:14 ]
|
|
2006-7-21 13:11 |
|
|
namejm
荣誉版主
       batch fan
积分 5226
发帖 1737
注册 2006-3-10 来自 成都
状态 离线
|
『第 23 楼』:
使用 LLM 解释/回答一下
path=%path%;%ProgramFiles%\Adobe\Acrobat 6.0\Reader\一句中,用%path%保留了原来默认的搜索路径,所以对直接运行ABC.exe没什么影响,如果去掉%path%,嘿嘿,那你就老老实实地把ABC.exe的绝对路径给添上吧。
除了用设置搜索路径的办法外,还可以直接用start命令来运行,不过要稍作改动,因为AcroRd32.exe的路径中带了空格符号:start "AcroRd32.exe程序的标题" “AcroRd32.exe的路径”
Last edited by namejm on 2006-7-21 at 13:34 ]
In the sentence "path=%path%;%ProgramFiles%\Adobe\Acrobat 6.0\Reader\", the %path% is used to retain the original default search path, so it has no impact on directly running ABC.exe. If you remove %path%, then you have to honestly add the absolute path of ABC.exe.
In addition to using the method of setting the search path, you can also run it directly using the start command, but it needs to be slightly modified because the path of AcroRd32.exe contains a space symbol: start "Title of AcroRd32.exe program" "Path of AcroRd32.exe"
Last edited by namejm on 2006-7-21 at 13:34 ]
|
|
2006-7-21 13:33 |
|
|
flying008
中级用户
  
积分 245
发帖 103
注册 2006-6-30
状态 离线
|
『第 24 楼』:
使用 LLM 解释/回答一下
你好……namejm
可是这个程序AcroRd32.exe用下面的语句
@echo
start "D:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe"
exit
就是不能启动,偶用START加引号试了N次了,
Hello……namejm
But this program AcroRd32.exe uses the following statement
@echo
start "D:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe"
exit
It just can't start. I've tried the START with quotes many times.
|
|
2006-7-21 13:57 |
|
|
namejm
荣誉版主
       batch fan
积分 5226
发帖 1737
注册 2006-3-10 来自 成都
状态 离线
|
『第 25 楼』:
使用 LLM 解释/回答一下
要用start "AcroRd32.exe的标题" "D:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe",你写对了吗?
You need to use start "Title of AcroRd32.exe" "D:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe". Did you write it correctly?
|
|
2006-7-21 14:05 |
|
|
zh159
金牌会员
     
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第 26 楼』:
使用 LLM 解释/回答一下
按照 namejm 的思路试了试:
@echo off
start "" "%ProgramFiles%\Adobe\Acrobat 7.0\Reader\AcroRd32.exe"
exit
也可以,其中第一个 "" 为 start 标题引号,可以不用写内容
Tried according to namejm's idea:
@echo off
start "" "%ProgramFiles%\Adobe\Acrobat 7.0\Reader\AcroRd32.exe"
exit
It's also okay. The first "" is the start title quote, and you can not write content
|
|
2006-7-21 14:10 |
|
|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第 27 楼』:
使用 LLM 解释/回答一下
对已安装的软件可以忽略路径
@echo off
start AcroRd32
exit
就行了
You can ignore the path for the installed software.
@echo off
start AcroRd32
exit
That's it.
|
|
2006-7-21 14:16 |
|
|
flying008
中级用户
  
积分 245
发帖 103
注册 2006-6-30
状态 离线
|
『第 28 楼』:
使用 LLM 解释/回答一下
Originally posted by namejm at 2006-7-21 14:05:
要用start "AcroRd32.exe的标题" "D:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe",你写对了吗?
为什么一定要]"AcroRd32.exe的标题"???偶就是没有写这个,
Originally posted by namejm at 2006-7-21 14:05:
You need to use start "Title of AcroRd32.exe" "D:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe", did you write it correctly? Why must it be ]"Title of AcroRd32.exe"? I just didn't write this.
|
|
2006-7-21 15:30 |
|
|
namejm
荣誉版主
       batch fan
积分 5226
发帖 1737
注册 2006-3-10 来自 成都
状态 离线
|
『第 29 楼』:
使用 LLM 解释/回答一下
“对已安装的软件可以忽略路径”?fastslz你不是在开玩笑吧?反正我把bat文件放在桌面上然后start安装在其他分区的某个程序,从来就没有成功过。
Re zxcv:
呵呵,想不到 start "" "程序路径" 这样的格式也可以,多谢提醒,又长了点知识:)
“Ignore the path for the installed software”? Fastslz, are you kidding? Anyway, I put the bat file on the desktop and then start to install a program in another partition, and it never succeeded.
Re zxcv:
Hehe, I didn't expect that the format of start "" "program path" can also work. Thanks for the reminder, I've learned something new again : )
|
|
2006-7-21 15:33 |
|
|
zh159
金牌会员
     
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第 30 楼』:
使用 LLM 解释/回答一下
Originally posted by fastslz at 2006-7-21 14:16:
对已安装的软件可以忽略路径
@echo off
start AcroRd32
exit
就行了
KAO,还真是
不过只能是一部分正确安装并在注册表注册了的才行,我试了正常安装的、AutoCAD可以
Originally posted by namejm at 2006-7-21 15:33:
Re zxcv:
呵呵,想不到 start "" "程序路径" 这样的格式也可以,多谢提醒,又长了点知识:)
其实也是定义了标题的,只不过标题为空而已
Last edited by zxcv on 2006-7-21 at 15:48 ]
Originally posted by fastslz at 2006-7-21 14:16:
For installed software, you can ignore the path
@echo off
start AcroRd32
exit
That's it
KAO, it's really
But it only works for a part of the software that is correctly installed and registered in the registry. I tried it, and it works for normally installed ones and AutoCAD.
Originally posted by namejm at 2006-7-21 15:33:
Re zxcv:
Hehe, I didn't expect that the format of start "" "program path" can also work. Thanks for the reminder, I've learned something new again :)
Actually, it also defines the title, but the title is just empty
|
|
2006-7-21 15:46 |
|