When you have a central file that controls workstation behavior (such as Oracle database locations), you want to automatically copy it down to the workstations each day, so you use a scheduled task. You use SCCM to deploy the task.
This is for a particular app that had some update requirements. @Echo on REM Uninstall ININ / ICIC elements, apply MS patches, Install latest ININ / ICIC elements REM 26-Jun-2017 REM Roger C. Set MyVer=220.127.116.11 Set MyError=NO Set MyWarning=NO set DEBUGGING=NO Call :InitLog if "%DEBUGGING%"=="YES" @echo on REM ============================================================== REM Set some required variables based … Continue reading Remove app, install MS Updates, install app
[BATCH script] @Echo off Set Version=18.104.22.168 Set Leader= set HOSTNAME=LOCALHOST rem set HostName=DT6761 if not "%1"=="" set HOSTNAME=%1 Call :Test %HostName% goto :EOF :Test rem goto :skip1 rem @ECHO ON echo ===[ %HOSTNAME% ]========= rem ============================= Echo Check NSLOOKUP rem ============================= NSLOOKUP %HOSTNAME% 2>nul|find /i "Name:">Nul if NOT errorlevel 1 ( echo %Leader% %HOSTNAME% DNS … Continue reading Simple batch file for testing system status
This routine will install Oracle from a network location, and also copy some files, and put some things into the registry. It is fully logged and includes some error checking. Features: Check registry for a value using REG QUERY Wait for process to end using TASKLIST Loop while waiting (using TIMEOUT) for processor utilization to … Continue reading Installing Oracle, with some tricks along the way
I found some systems where WMI was broken and needed a way to test if this was the case. Unfortunately the WMIC command doesn't set errorlevel, so it got a bit tricky.
We had issues with the SCCM client causing Windows Updates to fail, so rather than push a solution through SCCM, I pushed it through PSEXEC. Here's the batch file solution.
Batch file tricks that you might not use often enough to remember the details. If-then-else, subroutines, exit codes, system time.