It's pretty simple/limited, but here's how I'm
keeping clients up to date.  I run the code below
(check.bat) from the login script if the
current user has administrator rights to the
machine.  It uses psinfo from

http://www.sysinternals.com/ntw2k/freeware/pstools.shtml

to see what's installed on the local workstation,
and queues up anything that's not there.  It only
works for apps that register in add/remove programs,
though I'm experimenting with checking registry
values.

After calling check.bat, the login script runs
'%Z%\bin\todo.pl --go' if anything has been
queued.  %Z% has already been mapped earlier,
so no need to use mapznrun.

-- Daniel


=========
check.bat
=========

@echo off

if exist c:\netinst\todo.txt (
  echo todo.txt not empty, skipping inventory...
goto :eof
)

:: get windows version
ver | find "Windows XP" >nul 2>nul
if not errorlevel 1 set WINXP=y

ver | find "Windows 2000" >nul 2>nul
if not errorlevel 1 set WIN2000=y

:: check registered applications
for /F "delims=" %%a in ('%Z%\bin\psinfo -s') do call :check "%%a"

:: check version of autoexnt.bat script
call %windir%\system32\autoexnt.bat version
if errorlevel 3 set AUTOEXNT=y

goto :queue

:check
:: common apps
if %1 == "  Adobe Reader 6.0 6.0" set ADOBEREADER=y
if %1 == "  QuickTime " set QUICKTIME=y
if %1 == "  Java 2 Runtime Environment, SE v1.4.2_03 1.4.2_03" set SUNJRE=y
if %1 == "  7-Zip 3.13 " set SEVENZIP=y
if %1 == "  Mozilla (1.6) " set MOZILLA=y
if %1 == "  ActivePerl 5.8.3 Build 809 5.8.809" set PERL=y
goto :eof


:maybequeue
if %1 == . (
  echo queueing %2...
  %Z%\bin\todo.pl %2.bat
)
goto :eof


:execbyvalue
reg query %1 /v %2 | find "%3" >nul 2>nul
if errorlevel 1 (
  echo running %4 %5 %6 %7 %8 %9
  %4 %5 %6 %7 %8 %9
)
goto :eof

:queue
call :maybequeue %ADOBEREADER%. adobe-reader
call :maybequeue %QUICKTIME%. quicktime
call :maybequeue %SUNJRE%. sun-jre
call :maybequeue %SEVENZIP%. 7-zip
call :maybequeue %MOZILLA%. mozilla
call :maybequeue %PERL%. perl
call :maybequeue %AUTOEXNT%. autoexnt

if not %WINXP%. == . (
  echo windows xp detected...
)

if not %WIN2000%. == . (
  echo windows 2000 detected...
)


=============
end check.bat
=============



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
unattended-info mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unattended-info

Reply via email to