I don't know what can and can't be attached to these mailing lists so let me
know if you don't get the attachments.
There are 3 attachments, each are BAT files renamed to TXT files.
LOGIT.txt (this is the batch file that does the logging)
DOIT.txt (a hand edited DOIT batch to show how LOGIT might be used,
install.pl would need to be edited to generate the code)
MAPZNRUN.txt (again, a hand edit MAPZNRUN to show how LOGIT might be used,
install.pl would also need to be edited to generate the code)
I suppose the same could be done for POSTINST.BAT, however, it appears it's
just running some small things, like installing perl, setting up users in
the local administrators group and then setting up todo.pl. At least this
is one step closer to being able to find where something might fail before
todo.pl starts running.
Just in case the attached files don't make it through the mailing list, here
is the contents of LOGIT.BAT Hopefully it doesn't word wrap to badly. Each
command should be on one line and I've added an extra, empty line between
each line, so only the comments should have 2 lines right next to each
other.
:: ======== BEGIN LOGIT.BAT ========
:: Requires just 1 parameter, the message to log. However, it does assume
:: the directory netinst always exists and is named netinst
::
:: Example: logit.bat "SUCCESS: Something worked as expected."
SET msg=%1
SET logdir=%SystemDrive%\netinst\LOGS
SET logname=Unattended
SET logfile=%logdir%\%logname%.log
SET zdate=%date:~-4,4%%date:~-10,2%%date:~-7,2%
SET ztimestr=%time:~-11,2%:%time:~-8,2%:%time:~-5,2%:%time:~-2,2%
SET ztimefil=%time:~-11,2%%time:~-8,2%%time:~-5,2%%time:~-2,2%
IF NOT EXIST %logfile% echo %logname% Log (date|time|message) > %logfile%
ECHO %zdate%|%ztimestr%|%msg% > "%logdir%\%logname%_%zdate%_%ztimefil%.tmp"
REN "%logfile%" oldlog_%zdate%_%ztimefil%.tmp > nul
COPY "%logdir%\oldlog_%zdate%_%ztimefil%.tmp" +
"%logdir%\%logname%_%zdate%_%ztimefil%.tmp" "%logfile%" > nul
DEL "%logdir%\*.tmp" > nul
:: ======== ENDLOGIT.BAT ========
On Mon, May 12, 2008 at 7:19 AM, Don Fryers <[EMAIL PROTECTED]> wrote:
> Thanks Juan.
>
>
>
> Please send me the batch for logging so I can get more detail on what's
> happening.
>
>
>
> Don
>
>
> ------------------------------
>
> On Sat, May 10, 2008 at 2:05 AM, Juan Jose Pablos <[EMAIL PROTECTED]>
> wrote:
>
>
>
> Well,
> 1) make sure that you have the network interface up and running (ie.
> missing network drivers for windows)
>
> 2) execute the command: c:\netinst\mapzrun.bat
>
> 3) check if a Z network unit is created.
>
> unless the Z unit is created the whole process will not work.
>
>
> I was just about to suggest the same thing. I did 3 installs yesterday
> inside VMware. 2 worked flawlessly. However, one of them installed Perl
> and stopped. I can't tell if it rebooted at that point (I wasn't watching
> it), but noticed Z: wasn't mapped so I assume it rebooted and auto-logged
> back on once more, then failed to map Z:. Then went to a command prompt and
> manually ran the command:
>
> z:\bin\todo.pl --go
>
> Just checked on all 3 machines and everything that should have been
> installed was.
>
> If you're interested, I have some batch code I can clean up and put
> together for logging what the batch routines are doing, so a log could be
> inspected to see where and maybe why something stops.
>
> kevin
>
:: Requires just 1 parameter, the message to log. However, it does assume
:: the directory netinst always exists and is named netinst
::
:: Example: logit.bat "SUCCESS: Something worked as expected."
SET msg=%1
SET logdir=%SystemDrive%\netinst\LOGS
SET logname=Unattended
SET logfile=%logdir%\%logname%.log
SET zdate=%date:~-4,4%%date:~-10,2%%date:~-7,2%
SET ztimestr=%time:~-11,2%:%time:~-8,2%:%time:~-5,2%:%time:~-2,2%
SET ztimefil=%time:~-11,2%%time:~-8,2%%time:~-5,2%%time:~-2,2%
IF NOT EXIST %logfile% echo %logname% Log (date|time|message) > %logfile%
ECHO %zdate%|%ztimestr%|%msg% > "%logdir%\%logname%_%zdate%_%ztimefil%.tmp"
REN "%logfile%" oldlog_%zdate%_%ztimefil%.tmp > nul
COPY "%logdir%\oldlog_%zdate%_%ztimefil%.tmp" +
"%logdir%\%logname%_%zdate%_%ztimefil%.tmp" "%logfile%" > nul
DEL "%logdir%\*.tmp" > nul
IF EXIST c:\netinst\7916663.tmp EXITEMU
logit "Formatting C: now"
format /y /z:seriously /q /u /a /v: c:
if errorlevel 1 goto exit_formatfail
logit "Copy files from Y: to C:"
xcopy /s /e /y Y:\ C:\
logit "Copy files done"
logit "Starting Window install now"
Z:
cd Z:\os\win2ksp4\i386
winnt /rx:lang /s:Z:\os\win2ksp4\i386 /u:C:\netinst\unattend.txt
goto end
:exit_formatfail
logit "Formatting C: failed"
exit 1
:end
@echo off
if exist %SystemDrive%\netinst\permcred.bat call
%SystemDrive%\netinst\permcred.bat
if exist %SystemDrive%\netinst\tempcred.bat call
%SystemDrive%\netinst\tempcred.bat
if not %Z%. == . goto got_drive
set Z=Z:
:got_drive
:: If drive is already mapped, do nothing
if exist %Z%\ goto mapped
if not %Z_PATH%. == . goto got_path
set Z_PATH=\\ntinstall\install
:got_path
if %Z_USER%. == . goto no_user
if %Z_USER%. == "". goto no_user
set USER_ARG=/user:%Z_USER%
:no_user
:try_again
set COUNT=x%COUNT%
if not %COUNT% == xxxxxxxxxxxxxxxxxxxx goto mapit
echo Too many retries; giving up
logit "Too many retries for mapping Z:, giving up."
goto hang
:mapit
echo Mapping %Z_PATH% on %Z%...
if not %Z_PATH%. == dvd. goto not_dvd
%SystemDrive%\netinst\mapcd.js \bin\todo.pl %Z%
if exist %SystemDrive%\netinst\setzpath.bat call
%SystemDrive%\netinst\setzpath.bat
if exist %Z%\ goto mapped
echo Failed; retrying.
logit "Mapping Z: to DVD/CD failed, retrying."
:: Sleep for 10 seconds
ping -n 10 localhost > nul
goto try_again
:not_dvd
net use %Z% %Z_PATH% %Z_PASS% %USER_ARG% /persistent:no
if exist %Z%\ goto mapped
net use %Z% /delete
echo Failed; retrying.
logit "Mapping Z: to network share failed, retrying."
:: Sleep for 10 seconds
ping -n 10 localhost > nul
goto try_again
:mapped
echo ...done.
logit "Mapping Z: Successful."
:: Clean up environment, except for %Z% and %Z_PATH%
set Z_USER=
set Z_PASS=
set USER_ARG=
set COUNT=
:: Invoke command passed as argument
%1 %2 %3 %4 %5 %6 %7 %8 %9
if not errorlevel 1 goto end
echo FAILURE in mapznrun.bat
logit "FAILURE in mapznrun.bat"
:hang
goto hang
:end
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
unattended-info mailing list
unattended-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unattended-info