批处理将脚本添加到启动的最佳方法是什么

时间:2014-12-01 13:21:00

标签: batch-file batch-processing clearcase

我有一些用batch编写的脚本,它正在卸载Rational Softwares(ClearCase,ClearQuest),我正在为启动添加另一个脚本,但不知何故,当脚本运行时,这个注册表项被删除。 这是我的剧本:

SET ratinalDestFolder=C:\Rational_SW

SET UninstallTool=\\ta1bbn01\Public\Migration\CC\rationaluninstalltool.exe
::SET logFile=\\ta1bbn01\Public\Migration\uninstallLogs\%COMPUTERNAME%-%USERNAME%.log
SET logFile=%ratinalDestFolder%\%COMPUTERNAME%-%USERNAME%.log

ECHO Adding the registry file of the installation script
REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce /v RATIONAL_INSTALLATION /d \\ta1bbn01\Public\Migration\Alex\rationalInstallationWin64_Final.bat || ECHO Failed to add isntallation script

ECHO Copying the uninstall tool %ratinalDestFolder%
xcopy   %UninstallTool% %ratinalDestFolder%\

ECHO Uninstalling Rational Products

%ratinalDestFolder%\rationaluninstalltool.exe %logFile% -c

知道为什么在执行第一个脚本时删除添加到启动的脚本。

0 个答案:

没有答案