dearmb 发表于 2011-6-21 15:36:45

自动安装软件,需要改个BAT,谁会能帮改一下么?(已解决)

本帖最后由 dearmb 于 2011-6-22 13:21 编辑

批处理的内容是这样的
CD E:\back\setup
if exist autosetup.exe then
start E:\back\setup\autosetup.exe

在安装的时候没有出现问题,我的想法是安装结束后,将E:\back\setup\autosetup.exe删除掉,批处理执行之后,由于autosetup.exe 已经不存在,直接闪过就可以了
但是上面的批处理,在删除autosetup.exe 执行,前两句没有作用,start那句会执行,windows会提示找不到文件的对话框,我不想要对话框……
我想要,存在则执行,其余的情况就不要执行了
有谁会能帮改一下么?

cxlater 发表于 2011-6-21 15:40:36

你的197帖全部是侃大山侃来的

fuldho 发表于 2011-6-21 16:21:04

?????????????????????
del %0

xwt620 发表于 2011-6-21 21:53:09

CD E:\back\setup
if exist autosetup.exe then goto ST
goto EX

:ST
start E:\back\setup\autosetup.exe

dearmb 发表于 2011-6-22 09:25:21

你的197帖全部是侃大山侃来的
cxlater 发表于 2011-6-21 15:40 http://www.autoitx.com/images/common/back.gif

这是BAT,又不是au3,语法难道一样么???

dearmb 发表于 2011-6-22 09:31:03

CD E:\back\setup
if exist autosetup.exe then goto ST
goto EX

:ST
start E:\back\setup\autosetup ...
xwt620 发表于 2011-6-21 21:53 http://www.autoitx.com/images/common/back.gif

不好用阿,当文件存在时,没有运行

黑色袜子 发表于 2011-6-22 09:53:21

CD E:\back\setup
if exist autosetup.exe then
start E:\back\setup\autosetup.exebat if 需要then????

黑色袜子 发表于 2011-6-22 09:57:57

@echo off
CD E:\back\setup
if exist autosetup.exe goto :true
del %0
::上面是删除自身文件,就是不存在exe文件批处理文件就删除,如果你不想del删除上面那句代码就行,下同
exit
:true
start autosetup.exe
del autosetup.exe
del %0
exit

dearmb 发表于 2011-6-22 11:16:37

本帖最后由 dearmb 于 2011-6-22 11:22 编辑


黑色袜子 发表于 2011-6-22 09:57 http://www.autoitx.com/images/common/back.gif

谢谢,试用了,但是autosetup.exe没有运行起来
感觉if exist 根本没起到作用似的

love5173 发表于 2011-6-22 11:25:47

建议,这个程序是不是需要运行环境之类的,加参数试试

libosir 发表于 2011-6-22 11:33:35

不伦来类的。。哈工大

dearmb 发表于 2011-6-22 11:33:56

建议,这个程序是不是需要运行环境之类的,加参数试试
love5173 发表于 2011-6-22 11:25 http://www.autoitx.com/images/common/back.gif

这个程序,是我用AU3制作的自动安装程序,没有任何参数
我只是想,开机运行bat,bat检测是否有自动安装脚本,有,运行安装脚本,没有,结束bat

love5173 发表于 2011-6-22 11:55:18

回复 12# dearmb
早点说要求不就完事了,
解决方案,不管有没有都运行安装脚本,安装脚本第一步就是判断有没有安装文件如果有则安装没有就退出脚本程序,何必非要在bat里面纠结

黑色袜子 发表于 2011-6-22 12:12:38

谢谢,试用了,但是autosetup.exe没有运行起来
感觉if exist 根本没起到作用似的
dearmb 发表于 2011-6-22 11:16 http://www.autoitx.com/images/common/back.gif


    没运行起来???
@echo off
CD E:\back\setup
if exist autosetup.exe goto :true
echo 文件不存在
pause>nul
del %0
::上面是删除自身文件,就是不存在exe文件批处理文件就删除,如果你不想del删除上面那句代码就行,下同
exit
:true
start autosetup.exe
echo 运行成功
pause>nul
del %0
exit
你看看运行到哪里、!

黑色袜子 发表于 2011-6-22 12:14:33

我擦。你第一句就错了。弄我也没发现!!

把CD E:\back\setup
改成cd /d CD E:\back\setup
页: [1] 2
查看完整版本: 自动安装软件,需要改个BAT,谁会能帮改一下么?(已解决)