[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文件操作] [已解决]批处理怎样等待运行完一个文件在运行第二个?

本帖最后由 dnvplj 于 2014-12-17 14:25 编辑

请问各位朋友:C盘123文件夹里有3个EXE文件,我想让C:\123\1.exe软件安装完后在安装“C:\123\2.exe”,C:\123\2.exe安装完后在安装“C:\123\3.exe”,后边加静默安装参数/S
如:
C:\123\1.exe
C:\123\2.exe
C:\123\3.exe
1

评分人数

    • Batcher: 感谢给帖子标题标注[已解决]字样PB + 2

  1. @echo off
  2. start /wait "" "C:\123\1.exe" /S
  3. start /wait "" "C:\123\2.exe" /S
  4. start /wait "" "C:\123\3.exe" /S
复制代码

TOP

回复 2# DAIC
感谢回复,问题解决了,谢谢。

TOP

回复 2# DAIC

朋友您好,忘一个事,底下加上这段可以吗?
for %%a in (c d e) do del "%%a:\1.txt" "%%a:\2.txt" 2>nul

TOP

回复 4# dnvplj


    你自己试试就知道啦

TOP

回复 5# DAIC
朋友您好:
如果“C:\123\3.exe”不存在,不要提示怎么写?请指教。
C:\123\1.exe
C:\123\2.exe
C:\123\3.exe

TOP

回复 6# dnvplj
  1. @echo off
  2. if exist "C:\123\1.exe" (
  3.     start /wait "" "C:\123\1.exe" /S
  4. )
  5. if exist "C:\123\2.exe" (
  6.     start /wait "" "C:\123\2.exe" /S
  7. )
  8. if exist "C:\123\3.exe" (
  9.     start /wait "" "C:\123\3.exe" /S
  10. )
复制代码
2

评分人数

TOP

回复 7# DAIC
果然是高手,在次感谢。

TOP

回复 7# DAIC
请朋友,3个软件运行完后,如何将这3个文件删除,本人是菜鸟,和7楼的代码写到一起,谢谢了

TOP

回复 9# dnvplj
  1. @echo off
  2. if exist "C:\123\1.exe" (
  3.     start /wait "" "C:\123\1.exe" /S
  4.     del /f "C:\123\1.exe"
  5. )
  6. if exist "C:\123\2.exe" (
  7.     start /wait "" "C:\123\2.exe" /S
  8.     del /f "C:\123\2.exe"
  9. )
  10. if exist "C:\123\3.exe" (
  11.     start /wait "" "C:\123\3.exe" /S
  12.     del /f "C:\123\3.exe"
  13. )
复制代码

TOP

回复 10# DAIC
谢谢您朋友

TOP

回复 10# DAIC
朋友您好,请问,下面代码运行完之后,如何把“C:\123”文件夹给删除了,多谢了
if exist "C:\123\3.exe" (
    start /wait "" "C:\123\3.exe" /S
    del /f "C:\123\3.exe"
)

TOP

回复 12# dnvplj
  1. @echo off
  2. if exist "C:\123\1.exe" (
  3.     start /wait "" "C:\123\1.exe" /S
  4. )
  5. if exist "C:\123\2.exe" (
  6.     start /wait "" "C:\123\2.exe" /S
  7. )
  8. if exist "C:\123\3.exe" (
  9.     start /wait "" "C:\123\3.exe" /S
  10. )
  11. rd /s /q "C:\123"
复制代码

TOP

回复 13# DAIC
非常感您的回复

TOP

返回列表