archmonde11 Posted March 17, 2011 Share Posted March 17, 2011 I'm trying to silently install some InstallShield based programs. I use the following *.cmd file executed by runoneex. The Runoneex worked fine but the error arose when executing Others.cmd. A window appear notifying that Windows can not find the path for those programs. To clear this out, I Iogged on window XP, run the same *.exe which was used in Others.cmd by Run command with and without /s switch. The fact is that If I execute the *.exe with the /s, the same window notifying missing path appeared like the beginning. Anyone encountered the same problem?RUNONEEX...REG ADD %KEY%\0004 /VE /D "Other Programs" /fREG ADD %KEY%\0004 /V 0001 /D "%CDROM%\Apps\Others.cmd" /fOhers.cmdCLS@echo offTITLE Windows XP SP3 - Unattended InstallationECHO.ECHO Installing Unikey 4.0ECHO Please wait...start /wait %CDROM%\Apps\UKEY4.0\Unikey4.0.exe /sECHO.ECHO Installing WinRAR 3.2ECHO Please wait...start /wait %CDROM%\Apps\winrar3.2\winrar3.2.exe /sECHO.ECHO Installing Foxit Reader 3.0ECHO Please wait...start /wait %CDROM%\Apps\Foxit Reader3\FoxitRead3.exe /sECHO.ECHO Installing Copy File name 3.1ECHO Please wait...start /wait %CDROM%\Apps\CopyFilename31\copyfilenames31.exe /sECHO.ECHO Restarting the PC in 30 seconds...shutdown.exe -r -f -t 30 -c "Windows XP will now restart in 1/2 minute"EXIT Link to comment Share on other sites More sharing options...
RTK999 Posted March 17, 2011 Share Posted March 17, 2011 (edited) you didnt put the variable to find cdrom its like in runonceex when you put "SET CDROM=%%i:"use SetLocal enableextensions to local variables.Ohers.cmdCLS@echo offTITLE Windows XP SP3 - Unattended InstallationSetLocal enableextensionsSET CDROM=%~d0\Apps\ECHO.ECHO Installing Unikey 4.0ECHO Please wait...start /wait %CDROM%UKEY4.0\Unikey4.0.exe /sECHO.ECHO Installing WinRAR 3.2ECHO Please wait...start /wait %CDROM%winrar3.2\winrar3.2.exe /sECHO.ECHO Installing Foxit Reader 3.0ECHO Please wait...start /wait %CDROM%Foxit Reader3\FoxitRead3.exe /sECHO.ECHO Installing Copy File name 3.1ECHO Please wait...start /wait %CDROM%CopyFilename31\copyfilenames31.exe /sECHO.ECHO Restarting the PC in 30 seconds...shutdown.exe -r -f -t 30 -c "Windows XP will now restart in 1/2 minute"EndLocalEXIT Edited March 17, 2011 by RTK999 Link to comment Share on other sites More sharing options...
Yzöwl Posted March 17, 2011 Share Posted March 17, 2011 @ECHO OFF & SETLOCAL ENABLEEXTENSIONSTITLE Windows XP SP3 - Unattended Installation(SET CDROM=%~d0)CLSECHO=ECHO=Installing Unikey 4.0ECHO=Please wait...START /WAIT %CDROM%\Apps\UKEY4.0\Unikey4.0.exe /sECHO=ECHO=Installing WinRAR 3.2ECHO=Please wait...START /WAIT %CDROM%\Apps\winrar3.2\winrar3.2.exe /sECHO=ECHO=Installing Foxit Reader 3.0ECHO=Please wait...START "" /WAIT "%CDROM%\Apps\Foxit Reader3\FoxitRead3.exe" /sECHO=ECHO=Installing Copy File name 3.1ECHO=Please wait...START /WAIT %CDROM%\Apps\CopyFilename31\copyfilenames31.exe /sECHO=ECHO=Restarting the PC in 30 seconds...SHUTDOWN.EXE -r -f -t 30 -c "Windows XP will now restart in 1/2 minute"EXIT Link to comment Share on other sites More sharing options...
allen2 Posted March 17, 2011 Share Posted March 17, 2011 Usually "start " command need a title to work properly, so i would fix this also. Link to comment Share on other sites More sharing options...
Yzöwl Posted March 17, 2011 Share Posted March 17, 2011 Usually "start " command need a title to work properly, so i would fix this also.The start command would only require the 'title' double-quotes in the single case where I've provided them in my re-write above. This was because archmonde11's example command needed quoting due to the space in their path on that line and without the title, that quoted string may be mistaken for one. Link to comment Share on other sites More sharing options...
RTK999 Posted March 17, 2011 Share Posted March 17, 2011 @ECHO OFF & SETLOCAL ENABLEEXTENSIONSTITLE Windows XP SP3 - Unattended Installation(SET CDROM=%~d0)CLSECHO=ECHO=Installing Unikey 4.0ECHO=Please wait...START /WAIT %CDROM%\Apps\UKEY4.0\Unikey4.0.exe /sECHO=ECHO=Installing WinRAR 3.2ECHO=Please wait...START /WAIT %CDROM%\Apps\winrar3.2\winrar3.2.exe /sECHO=ECHO=Installing Foxit Reader 3.0ECHO=Please wait...START "" /WAIT "%CDROM%\Apps\Foxit Reader3\FoxitRead3.exe" /sECHO=ECHO=Installing Copy File name 3.1ECHO=Please wait...START /WAIT %CDROM%\Apps\CopyFilename31\copyfilenames31.exe /sECHO=ECHO=Restarting the PC in 30 seconds...SHUTDOWN.EXE -r -f -t 30 -c "Windows XP will now restart in 1/2 minute"EXITyou miss EndLocal to work properly. Link to comment Share on other sites More sharing options...
archmonde11 Posted March 18, 2011 Author Share Posted March 18, 2011 Thanks all of you for your replies. Finally I have this others.cmd. It worked like charm! This forum is so GREAT!@ECHO OFF & SETLOCAL ENABLEEXTENSIONSTITLE Windows XP SP3 - Unattended Installation(SET CDROM=%~d0)CLSECHO=ECHO=Installing Unikey 4.0ECHO=Please wait...START /WAIT %CDROM%\Apps\UKEY4.0\Unikey4.0.exe /sECHO=ECHO=Installing WinRAR 3.2ECHO=Please wait...START /WAIT %CDROM%\Apps\winrar3.2\winrar3.2.exe /sECHO=ECHO=Installing Foxit Reader 3.0ECHO=Please wait...START "" /WAIT "%CDROM%\Apps\Foxit Reader3\FoxitRead3.exe" /sECHO=ECHO=Installing Copy File name 3.1ECHO=Please wait...START /WAIT %CDROM%\Apps\CopyFilename31\copyfilenames31.exe /sECHO=ECHO=Restarting the PC in 30 seconds...SHUTDOWN.EXE -r -f -t 30 -c "Windows XP will now restart in 1/2 minute"EndLocalEXIT Link to comment Share on other sites More sharing options...
jaclaz Posted March 18, 2011 Share Posted March 18, 2011 you miss EndLocal to work properly.May I ask WHY? jaclaz Link to comment Share on other sites More sharing options...
RTK999 Posted March 18, 2011 Share Posted March 18, 2011 you miss EndLocal to work properly.May I ask WHY? jaclazwill work anyway but if you have another functions or batch files in the same script could interfere with those functions 'cause setlocal will continues until find endlocal command. Link to comment Share on other sites More sharing options...
jaclaz Posted March 19, 2011 Share Posted March 19, 2011 (edited) will work anyway but if you have another functions or batch files in the same script could interfere with those functions 'cause setlocal will continues until find endlocal command.Well, that is a possibility , but since it is right before an EXIT (which in my view is also not *really*needed ) and right after a SHUTDOWN command , I doubt the specific batch won't "work properly". jaclaz Edited March 19, 2011 by jaclaz Link to comment Share on other sites More sharing options...
RTK999 Posted March 19, 2011 Share Posted March 19, 2011 will work anyway but if you have another functions or batch files in the same script could interfere with those functions 'cause setlocal will continues until find endlocal command.Well, that is a possibility , but since it is right before an EXIT (which in my view is also not *really*needed ) and right after a SHUTDOWN command , I doubt the specific batch won't "work properly". jaclazyes but sometimes i'm going adding new code to the script, that 'cause, but whatever, anyone could make thing the way they like it. Link to comment Share on other sites More sharing options...
jaclaz Posted March 19, 2011 Share Posted March 19, 2011 yes but sometimes i'm going adding new code to the script, that 'cause, but whatever, anyone could make thing the way they like it.Sure just trying to:http://en.wikiquote.org/wiki/Albert_EinsteinIt can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience. "On the Method of Theoretical Physics" The Herbert Spencer Lecture, delivered at Oxford (10 June 1933); also published in Philosophy of Science, Vol. 1, No. 2 (April 1934), pp. 163-169. [thanks to Dr. Techie @ www.wordorigins.org and JSTOR]Variants: Everything should be made as simple as possible, but no simpler.Everything should be made as simple as possible, but not simpler.This is very similar to "Occam's Razor", with the addition that it warns about too much simplicity. Dubbed ''Einstein's razor, it is used when an appeal to Occam's razor results in an over-simplified explanation insufficient to meet needs or goals. It is also similar to one expression of what has become known as the "KISS principle": Keep It Simple, Stupid — but never oversimplify. jaclaz Link to comment Share on other sites More sharing options...
Yzöwl Posted March 19, 2011 Share Posted March 19, 2011 As jaclaz said, not only was the ENDLOCAL not required neither was the EXIT command, (I only added it so that the Topic starter would recognise that it was effectively still their entire file and prevent them from messing with it).RTK999 even with the non-required last line the script I provided would have worked perfectly, yours however would not. Also If changing the CDROM variable as you did, Id have preferred to have seen you use: (SET CDROM=%~dp0)Based on the level of knowledge shown by the Topic starter, I'd be inclined to advise against them adding additional code to the script. It'd likely require debugging to work properly and we're not here to debug a script at several stages through its development. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now