B.Bill Posted July 26, 2006 Posted July 26, 2006 I am running a batch file from GuiRunOnce. The batch file takes about 2 minutes or so to complete if ran by hand, and completes with no issues. It installs several pieces of software, and does some quick checks to see if certain hotfixes are installed. When GuiRunOnce comes up after install, I see it kick off the batch file, but it finishes very quickly, with no obvious errors, and none of the software is installed. Here are the contents of the RunOnceEx.cmd:@echo offSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Installing Applications" /fREG ADD %KEY%\005 /VE /D "install.bat" /fREG ADD %KEY%\005 /V 1 /D "%systemdrive%\AP\install.bat" /fREG ADD %KEY%\010 /VE /D "Sanupdate.bat" /fREG ADD %KEY%\010 /V 1 /D "%systemdrive%\SanKit\5.26\InstallScript\sanupdate.bat" /fEXITsanupdate.bat is the one that is having the issue.
RogueSpear Posted July 26, 2006 Posted July 26, 2006 Just so we're on the same page here... the code you posted should take a fraction of a second to run and I'm guessing it runs fine. The sanupdate.bat file that you mentioned is having problems is running from RunOnceEx. Since GuiRunOnce and RunOnceEx kick off at essentially the same time and you're intructing RunOnceEx to launch sanupdate.bat, then you'll have to reboot for sanupdate.bat to run.I would suggest running the code you posted from cmdlines.txt if you want the RunOnceEx settings to take effect after the first reboot.
B.Bill Posted July 26, 2006 Author Posted July 26, 2006 Maybe I am confused. Here is the contents of my cmdlines.txt:[COMMANDS]"RunOnceEx.cmd"It just kicks off RunOnceex.cmd, which I posted earlier. RunOnceex.cmd will run install.bat and sanupdate.bat on first logon (I have autologon enabled and autologoncount set to 1). Shouldnt this just run install.bat and sanupdate.bat?
RogueSpear Posted July 26, 2006 Posted July 26, 2006 I am running a batch file from GuiRunOnce. The batch file takes about 2 minutes or so to complete if ran by hand, and completes with no issues.@echo offSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Installing Applications" /fREG ADD %KEY%\005 /VE /D "install.bat" /fREG ADD %KEY%\005 /V 1 /D "%systemdrive%\AP\install.bat" /fREG ADD %KEY%\010 /VE /D "Sanupdate.bat" /fREG ADD %KEY%\010 /V 1 /D "%systemdrive%\SanKit\5.26\InstallScript\sanupdate.bat" /fEXITsanupdate.bat is the one that is having the issue.Perhaps this where I was confused. It seemed as though you were saying that the code above was running from GuiRunOnce.Maybe I am confused. Here is the contents of my cmdlines.txt:[COMMANDS]"RunOnceEx.cmd"It just kicks off RunOnceex.cmd, which I posted earlier. RunOnceex.cmd will run install.bat and sanupdate.bat on first logon (I have autologon enabled and autologoncount set to 1). Shouldnt this just run install.bat and sanupdate.bat?RunOnceex.cmd, if it's code from post #1, will not run the batch files, but rather it will set them to run from RunOnceEx. So it does not appear as though anything is running from GuiRunOnce - at least not from what you've described thus far. If there is a problem with sanupdate.bat, then perhaps you would like to post that code. How and when are you getting the SanKit\5.26\InstallScript directory on to your system drive?
B.Bill Posted July 26, 2006 Author Posted July 26, 2006 I have the directories in the $oem$\$1\ folder:$oem$\$1\AP\$oem$\$1\SanKit\I must be confused about the GuiRunOnce. I thought the RunOncecmd was GuiRunOnce (disregard my ignorance). The code at the top is from the RunOnceex.cmd file. The sanupdate.bat runs fine if ran manually, so I dont think its something with the script. I just need these 2 batch files to run to install the san software on the machines. Is this not the place to do it?
RogueSpear Posted July 26, 2006 Posted July 26, 2006 Well I don't see anything immediately that's wrong with your batch file setting the ROE entries. The only thing I can really think of is that something is not being found. One troubleshooting suggestion for circumstances like this is to verify your target exists. Try inserting an IF EXIST in there to see if "%systemdrive%\SanKit\5.26\InstallScript\sanupdate.bat is found by the batch file.
B.Bill Posted July 26, 2006 Author Posted July 26, 2006 The batch files are being found, but arent completing. Could it bebecause something the batch file is looking for under the \SanKit\ directory hasnt been completely copied over yet? (its about 300Meg). Is there a better place to run the batch files automatically?
RogueSpear Posted July 26, 2006 Posted July 26, 2006 If you're copying over everything via $OEM$\$1, then it all get copied during the text mode portion of setup. So it's there long before. This is why I was interested in the batch file. If it's working when run manually, but from RunOnceEx, I figured there may be something of interest to look at.If there's anything sensitive in the batch file, just XXXX all of that out if you'd like to post it.
B.Bill Posted July 26, 2006 Author Posted July 26, 2006 (edited) Here are the contents of sanupdate. I just didnt post it because it was large. @echo offset rtn=0set hbaqlcnt=0set hbaemxcnt=0set hbacnt=0set temp=%systemdrive%\tempset ver=SANDec-14-05if NOT exist %temp% mkdir %temp% >NUl 2>NULif "%1" == "" goto doitif NOT "%1" == "/f" ( echo Usage - echo sanupdate echo or echo sanupdate /f echo /f - force update all components echo. goto done):doitecho. > %temp%\SAN_UPDATES.logecho Log file for SAN updates created on %date% %time% Version %ver% >> %temp%\SAN_UPDATES.logecho.>> %temp%\SAN_UPDATES.logsysteminfo | find /I "os name" | find /I "2003" >> %temp%\SAN_UPDATES.logif NOT "%errorlevel%" == "0" ( echo Package not for this system. echo Package not for this system >> %temp%\SAN_UPDATES.log set rtn=5 goto done)echo. >> %temp%\SAN_UPDATES.logrem Check for hotfixcscript /nologo hotfix.vbs | find /i "908980"if NOT "%errorlevel%" EQU "0" ( echo Hotfix Q908980 not installed. Updated Aborted. echo Install hotfix , reboot and then rerun updates. echo Hotfix Q908980 not installed. Updated Aborted. >> %temp%\SAN_UPDATES.log echo Install hotfix , reboot and then reun updates. >> %temp%\SAN_UPDATES.log set rtn=4 goto done)echo Performing SAN Updates For Emulex HBA's...>> %temp%\SAN_UPDATES.logecho.>> %temp%\SAN_UPDATES.log:commonecho.echo. >> %temp%\SAN_UPDATES.logecho Installing/Updating Common Applications..echo Installing/Updating Common Applications.. >> %temp%\SAN_UPDATES.logecho. >> %temp%\SAN_UPDATES.logecho Quering All HBA's ...device count allhba-ids.txtset hbacnt=%errorlevel%echo Number of HBA cards detected : %hbacnt%if "%hbacnt%" == "0" ( echo No HBA controllers found in this server. echo No HBA controllers found in this server. >> %temp%\SAN_UPDATES.log echo. >> %temp%\SAN_UPDATES.log echo SAN update not performed. echo SAN update not performed. >> %temp%\SAN_UPDATES.log set rtn=5 goto done)if /I "%PROCESSOR_ARCHITECTURE%" == "x86" ( set snapacks=pe-Navisphere_agent pe-powerpath32) else if /I "%PROCESSOR_ARCHITECTURE%" == "AMD64" ( set snapacks=pe-Navisphere_agent pe-powerpath64) else if /I "%PROCESSOR_ARCHITECTURE%" == "IA64" ( set snapacks=pe-Navisphere_agent pe-powerpathia64) else ( echo Package not for this system. echo Package not for this system >> %temp%\SAN_UPDATES.log set rtn=5 goto done)set displaynames=Navisphere_Agent PowerPathREM back up navisphere configuration fileif exist %temp%\agent.config ( del /S /Q %temp%\agent.config 2>NUl 1>NUL)if exist "%ProgramFiles%\EMC\Navisphere Agent\agent.config" ( copy "%ProgramFiles%\EMC\Navisphere Agent\agent.config" %temp%\agent.config 2>NUl 1>NUL)set lice=if %hbaqlcnt% GTR 1 (set lice=XXXX-XXXX-XXXX-XXXX-XXXX)if %hbaemxcnt% GTR 1 (set lice=XXXX-XXXX-XXXX-XXXX-XXXX)Rem execute all the update packsfor %%i in (%snapacks%) do call :execpacks %%i %lice%if "%rtn%" == "" goto EOFREM restore navisphere configuration file copy /Y agent.config "%ProgramFiles%\EMC\Navisphere Agent" 2>NUl 1>NUL::if /I "%PROCESSOR_ARCHITECTURE%" == "x86" (:: rem installing powerpath patch:: start /wait EMCPP.W2003_32.4.3.1.P1.b114.exe /s /fe /v"/q REBOOT=ReallySuppress"::) else if /I "%PROCESSOR_ARCHITECTURE%" == "ia64" (:: start /wait EMCPP.W2003_64.4.3.1.P1.b114.exe /s /fe /v"/q REBOOT=ReallySuppress"::))rem installing powerpath efixif /I "%PROCESSOR_ARCHITECTURE%" == "x86" ( echo Installing PowerPath Efix echo. >> %temp%\SAN_UPDATES.log echo Installing PowerPath Efix >> %temp%\SAN_UPDATES.log start /wait EMCPower.W2003_32.4.5.0.EF1.GA.exe /s /fe /v"/q REBOOT=ReallySuppress") else if /I "%PROCESSOR_ARCHITECTURE%" == "AMD64" ( echo Installing PowerPath Efix echo. >> %temp%\SAN_UPDATES.log echo Installing PowerPath Efix >> %temp%\SAN_UPDATES.log start /wait EMCPower.W2003_X64.4.5.0.EF1.GA.exe /s /fe /v"/q REBOOT=ReallySuppress")Rem install Solutions Enabler:doneset err=set hbacnt=set hbaemxcnt=set hbaqlcnt=set lice=echo return code : %rtn%echo return code : %rtn% >> %temp%\SAN_UPDATES.logseterror %rtn%set rtn=goto EOF:execpacksif "%rtn%" == "" goto EOFif not exist "%~n1.exe" goto EOFecho Installing/Updating %~n1 ...start /wait %1 /s %2set err=%errorlevel%type %temp%\%1.log >> %temp%\SAN_UPDATES.logecho.>> %temp%\SAN_UPDATES.logif "%err%" == "1" ( echo Error updating %1. echo Exiting with return code : 1 set rtn=1 goto done):EOF Edited July 26, 2006 by B.Bill
RogueSpear Posted July 26, 2006 Posted July 26, 2006 I don't really see anything that stands out in the batch file, but then again I'm more of a VB guy than batch. Perhaps one of MSFN's resident batch experts will take a look and see something.
B.Bill Posted July 26, 2006 Author Posted July 26, 2006 A little more info. I added a log to the batch file and it is complaining about a hotfix not being applied. I added the hotfix to the image with the /integrate option. The batch file calls a vbs script that looks for the hotfixes that have been applied here:cscript /nologo hotfix.vbs | find /i "908980"this portion must be failing when running via RunOnceex.cmd. hotfix.vbs is on the %systemdrive% in the same dir as sanupdate.bat. After the system logs in the first time, if I run this by hand, it finds the hotfix with no issues. Any ideas?
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now