除非单独运行行,否则无效的开关

时间:2016-06-24 18:10:07

标签: batch-file installshield invalid-characters

我的.BAT有一个Install Shield行,无效的switch / s出错,除非它在单独的命令提示符下运行。我对这一切都很陌生,我能想到的只是因为它是一种不同的语法。有没有办法让它在与安装的其余部分相同的批次中运行?

这是问题中的一行:

    START /wait %desktop%\Serverx64\CDImage_1100_1003a\setup.exe /s /a /s /sms /f1c:\Temp\setup.iss

这是我的.BAT:

@echo off
@echo Installing SQL

MD C:\tempdasql

COPY ConfigurationFile.ini C:\tempdasql > nul
SQLEXPRWT_x64_ENU /ConfigurationFile="C:\tempdasql\ConfigurationFile.ini"
@echo SQL Installed
@echo:

@echo Installing 2005 BC
MSIEXEC /i SQLServer2005_BC_x64.msi /qb
@echo Installed 2005 BC
@echo:

DEL C:\tempdasql\ConfigurationFile.ini
RD C:\tempdasql

TIMEOUT /T 3
@echo:
@echo Installing WinRAR

SET desktop="%userprofile%\Desktop"

START "WinRAR" /wait %desktop%\Serverx64\winrar\wrar393.exe /s

SET winrar="C:\program Files\WinRAR\WinRAR.exe"

MD %userprofile%\Desktop\Serverx64\CDImage_1100_1003a\
@echo Extracting Foo
@echo:

%winrar% x %desktop%\Serverx64\CDImage_1100_1003a.iso %desktop%\Serverx64\CDImage_1100_1003a\

TIMEOUT /T 3
@echo:
@echo Installing Foo

MD C:\Temp

COPY %desktop%\Serverx64\Setup.iss C:\Temp\ >nul


START /wait %desktop%\Serverx64\CDImage_1100_1003a\setup.exe /s /a /s /sms /f1c:\Temp\setup.iss

DEL C:\Temp\setup.iss
RD C:\Temp

Copy C:\Foo\msvcr71.dll C:\Foo\Support\ >nul
START C:\Foo\Support\Pmtools.exe

1 个答案:

答案 0 :(得分:2)

修复由Aschipfl提供。    在START之后放置一个“”来创建一个空字符串解决了这个问题。如果没有START命令后面的字符串,则批处理错误地处理了我的文件路径并切换。