Board logo

标题: [文件操作] [已解决]批处理怎样等待运行完一个文件在运行第二个? [打印本页]

作者: dnvplj    时间: 2014-12-17 11:18     标题: [已解决]批处理怎样等待运行完一个文件在运行第二个?

本帖最后由 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
作者: DAIC    时间: 2014-12-17 12:32

  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
复制代码

作者: dnvplj    时间: 2014-12-17 14:24

回复 2# DAIC
感谢回复,问题解决了,谢谢。
作者: dnvplj    时间: 2014-12-17 15:47

回复 2# DAIC

朋友您好,忘一个事,底下加上这段可以吗?
for %%a in (c d e) do del "%%a:\1.txt" "%%a:\2.txt" 2>nul
作者: DAIC    时间: 2014-12-17 18:13

回复 4# dnvplj


    你自己试试就知道啦
作者: dnvplj    时间: 2014-12-17 18:27

回复 5# DAIC
朋友您好:
如果“C:\123\3.exe”不存在,不要提示怎么写?请指教。
C:\123\1.exe
C:\123\2.exe
C:\123\3.exe
作者: DAIC    时间: 2014-12-17 19:08

回复 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. )
复制代码

作者: dnvplj    时间: 2014-12-17 19:18

回复 7# DAIC
果然是高手,在次感谢。
作者: dnvplj    时间: 2014-12-19 14:19

回复 7# DAIC
请朋友,3个软件运行完后,如何将这3个文件删除,本人是菜鸟,和7楼的代码写到一起,谢谢了
作者: DAIC    时间: 2014-12-19 14:22

回复 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. )
复制代码

作者: dnvplj    时间: 2014-12-19 16:31

回复 10# DAIC
谢谢您朋友
作者: dnvplj    时间: 2014-12-21 16:21

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

回复 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"
复制代码

作者: dnvplj    时间: 2014-12-21 18:18

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




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2