Changing Security Context
Install Drivers + Symantec + Encryption + Remote Software + Splash Screen + Onscreen Countdown
Remotely Install Symantec AV 11
Query Symantec 11 4000/4202 on Network
Restrict Guest Access
PING List Of Computers



bar1

 

Δ Changing Security Context
bar1


Okay, there are really many ways to change security context when launching programs for both local and remote workstations. And, what I mean by this, is if you would like your end-user to be able to install or launch a setup file, however they do NOT have priviledges to install apps or access local resources like the cdrom or c:\drive on their workstation, what this command set would allow them to do is launch or install an app by using a compiled, secure script that changes the security context from a less priviledged user to a more priviledged user. This opens up an entire spectrum for application deployment and automation. You will be able to deploy apps for both offline and online end-users, for both local and remote users, whether or not they have rights to install software or updates to their workstation. It's pretty easy to create a service account that all your scripts will use; this will make tracking and auditing much easier.

On to the scripts...

When changing security context locally, I like to use a program called sanur to pipe a password when using the regular windows RUNAS utility. It would look like this in a script (note: this could be easily ported to other languages like VBScript):


Method 1:
@runas /u:administrator \\server\YourProgram.exe | \\server\sanur.exe password



And, I like to use this when changing security context remotely, psexec by sysinternals:
Method 2:
psexec \\%computername%
-u administrator -p password -d YourCommand.CMD

psexec \\%computername%
-u administrator -p password -i -d explorer.exe /separate,c:\
psexec \\%computername% -u administrator -p password -i -d taskmgr.exe
psexec \\%computername% -u administrator -p password -i -d "C:\Program Files\Internet Explorer\iexplore.exe" "google.com"
psexec \\%computername% -u administrator -p password -i -d explorer.exe /separate,\\server\FolderName
psexec \\%computername%
-u administrator -p password -i -d regedit.exe
psexec \\%computername% -u administrator -p password -i -d "C:\WINDOWS\pchealth\helpctr\binaries\msconfig.exe"

bar1
bar1





Δ Install HP Drivers, Anti-Virus, Encryption, Remote Software
Silently+Splash Screen+Logs+Onscreen Countdown

bar1


WOW! I went ahead and got that out of the way, as our new project takes us on a long journey of software app updates, driver updates, and special design concepts.

Our next scripting project requires many functioning, moving parts. We will be adding a verification routine that make sure the users machine meets certain conditions to even start the update, software copy, software extraction, software updating, along with splash screens, progress bars, and onscreen countdown for our end-user. The general idea is to make our installation/update as painless as possible for the end-user, while also keeping it very professional looking. We do have a slim timeline for coding completion, so we need to code swiftly but carefully towards our goal.

bar1

   Here are our specs:








Install HP Drivers on workstation without user intervention
Install anti-virus
Install encryption software
Must have splash screen
Must have progress bar
Must have onscreen countdown
Must "all" run from CD
Report complete to log
To be coded in 14 days
Extra- it would be nice if the time and date showed in the splash screen

bar1

@ECHO OFF
@rem ******************************************************************
@rem Script: YourCommand.cmd
@rem Purpose: To update all HP Drivers + Symantec + Encryption on end-users laptop
@rem Creation Date: 10/26/09
@rem Last Modified:
@rem Author: Eddie S. Jackson
@rem E-Mail:
MrNetTek@gmail.com
@rem *********************************************************************

Title = HP Drivers
:BEGIN
@rem CREATES A POPUP FOR END-USER
Echo popup = msgbox("Please save and close all your work as a reboot will be required once workstation has been updated. Press the OK button when you are ready to continue.",,"HP Updates") > %temp%\popup_continue.vbs
Start /wait %temp%\popup_continue.vbs

@rem CREATES DRVERUPDATE FOLDER
@MD c:\DriversUpdate
ping 127.0.0.1 -n 1 > nul
Echo MD c:\DriversUpdate > c:\DriversUpdate\MstExeLog.txt

@rem THIS KILLS ANY MSHTA.EXE,SETUP.EXE, MSIEXEC.EXE AND THE EXPLORER.EXE CURRENTLY RUNNNING
@Taskkill /f /im mshta.exe
Echo Taskkill /f /im mshta.exe >> c:\driversupdate\MstExeLog.txt
@Taskkill /f /im setup.exe
Echo Taskkill /f /im setup.exe >> c:\driversupdate\MstExeLog.txt
@Taskkill /f /im msiexec.exe
Echo Taskkill /f /im msiexec.exe >> c:\driversupdate\MstExeLog.txt
@Taskkill /f /im explorer.exe
Echo Taskkill /f /im explorer.exe >> c:\driversupdate\MstExeLog.txt

@rem THIS COPIES OVER SPLASH SCREEN
@XCOPY "d:\files\splash.hta" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\splash.hta" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt
@XCOPY "d:\files\splash.JPG" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\splash.JPG" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt
@XCOPY "d:\files\progressbar.hta" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\progressbar.hta" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt
@XCOPY "d:\files\progress.gif" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\progress.gif" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt
@XCOPY "d:\files\COUNTER.HTA" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\COUNTER.HTA" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt
@XCOPY "d:\files\resplash.vbs" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\resplash.vbs" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt

@rem LAUNCHES SPLASH...
start c:\DriversUpdate\splash.hta & ping 127.0.0.1 > nul
Echo start "" c:\driversupdate\splash.hta >> c:\driversupdate\MstExeLog.txt

@rem LAUNCHES PROGRESS BAR...
rem ping 127.0.0.1 -n 3 > nul
rem Echo ping 127.0.0.1 -n 3 > nul >> c:\driversupdate\MstExeLog.txt
start c:\driversupdate\progressbar.hta & ping 127.0.0.1 > nul
Echo start "" c:\driversupdate\progressbar.hta >> c:\driversupdate\MstExeLog.txt

@rem stops Update Service temporarily, restarts at end of udpates
@net stop wuauserv
Echo net stop wuauserv >> c:\driversupdate\MstExeLog.txt

@rem LAUNCHES THE COUNTER
rem ping 127.0.0.1 -n 3 > nul
rem Echo ping 127.0.0.1 -n 3 > nul >> c:\driversupdate\MstExeLog.txt
start c:\driversupdate\COUNTER.hta & ping 127.0.0.1 > nul
Echo start "" c:\driversupdate\COUNTER.hta >> c:\driversupdate\MstExeLog.txt

@rem COPY DRIVER FILES FROM SOURCE TO TARGET
start "" "C:\DriversUpdate\resplash.vbs"
cls
Echo cls >> c:\driversupdate\MstExeLog.txt
Echo Copying HP Driver Updates...
Echo Echo Copying HP Driver Updates... >> c:\driversupdate\MstExeLog.txt
@XCOPY "d:\files\ATIVideosp43762.exe" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\ATIVideosp43762.exe" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt
@XCOPY "d:\files\Camerasp41512.exe" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\Camerasp41512.exe" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt
@XCOPY "d:\files\Buttonssp44777.exe" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\Buttonssp44777.exe" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt
@XCOPY "d:\files\Intel2567LMGigabitEthernetsp45622.exe" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\Intel2567LMGigabitEthernetsp45622.exe" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt
@XCOPY "d:\files\IntelChipsetsp41388.exe" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\IntelChipsetsp41388.exe" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt
@XCOPY "d:\files\IntelPROWirelesssp44294.exe" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\IntelPROWirelesssp44294.exe" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt
@XCOPY "d:\files\Modemsp42851.exe" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\Modemsp42851.exe" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt
@XCOPY "d:\files\SOUNDsp42375.exe" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\SOUNDsp42375.exe" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt
@XCOPY "d:\files\SynapticTouchpadsp44921.exe" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\SynapticTouchpadsp44921.exe" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt
@XCOPY "d:\files\IntelMatrixStoragesp45106.exe" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\IntelMatrixStoragesp45106.exe" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt
@XCOPY "d:\files\Camerasp39323.exe" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\Camerasp39323.exe" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt

@rem COPIES OVER CUSTOMIZED SETUP SCRIPTS
start "" "C:\DriversUpdate\resplash.vbs"
@XCOPY "d:\files\SP41512setup.iss" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\SP41512setup.iss" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt

@XCOPY "d:\files\SP42375setup.iss" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\SP42375setup.iss" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt

@XCOPY "d:\files\sp43762setup.iss" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\sp43762setup.iss" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt

@XCOPY "d:\files\SP44777setup.iss" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\SP44777setup.iss" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt

@XCOPY "d:\files\ATIFULLsetup.iss" "C:\DriversUpdate" /Y /V /Q /H
Echo XCOPY "d:\files\ATIFULLsetup.iss" "C:\DriversUpdate" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt

@rem COPY ENCRYPTION FROM SOURCE TO TARGET
start "" "C:\DriversUpdate\resplash.vbs"
@XCOPY "d:\files\ENCRYPTION\ENCRYPTION.exe" "C:\DriversUpdate\ENCRYPTION\" /Y /V /Q /H
Echo XCOPY "d:\files\ENCRYPTION\ENCRYPTION.exe" "C:\DriversUpdate\ENCRYPTION\" /Y /V /Q /H >> c:\driversupdate\MstExeLog.txt

@rem COPY SYMANTEC 11 FROM SOURCE TO TARGET
start "" "C:\DriversUpdate\resplash.vbs"
XCOPY "d:\files\SEP11\*.*" "C:\DriversUpdate\sep11\" /Y /E /V /Q /H
Echo XCOPY "d:\files\SEP11\*.*" "C:\DriversUpdate\sep11\" /Y /E /V /Q /H >> c:\driversupdate\MstExeLog.txt

@rem UNPACKING AREA
CLS
Echo CLS >> c:\driversupdate\MstExeLog.txt
start "" "C:\DriversUpdate\resplash.vbs"
Echo Unpacking HP Driver Update Camerasp41512.exe...
Echo Echo Unpacking HP Driver Update Camerasp41512.exe... >> c:\driversupdate\MstExeLog.txt
START /wait C:\DriversUpdate\Camerasp41512.exe -e -s
Echo START /wait C:\DriversUpdate\Camerasp41512.exe -e -s >> c:\driversupdate\MstExeLog.txt

CLS
Echo CLS >> c:\driversupdate\MstExeLog.txt
start "" "C:\DriversUpdate\resplash.vbs"
Echo Unpacking HP Driver Update Buttonssp44777.exe...
Echo Echo Unpacking HP Driver Update Buttonssp44777.exe... >> c:\driversupdate\MstExeLog.txt
START /wait C:\DriversUpdate\Buttonssp44777.exe -e -s
Echo START /wait C:\DriversUpdate\Buttonssp44777.exe -e -s >> c:\driversupdate\MstExeLog.txt

CLS
Echo CLS >> c:\driversupdate\MstExeLog.txt
start "" "C:\DriversUpdate\resplash.vbs"
Echo Unpacking HP Driver Update Intel2567LMGigabitEthernetsp45622.exe...
Echo Echo Unpacking HP Driver Update Intel2567LMGigabitEthernetsp45622.exe... >> c:\driversupdate\MstExeLog.txt
START /wait C:\DriversUpdate\Intel2567LMGigabitEthernetsp45622.exe -e -s && (Echo START /wait C:\DriversUpdate\Intel2567LMGigabitEthernetsp45622.exe -e -s >> c:\driversupdate\MstExeLog.txt)

CLS
Echo CLS >> c:\driversupdate\MstExeLog.txt
start "" "C:\DriversUpdate\resplash.vbs"
Echo Unpacking HP Driver Update IntelChipsetsp41388.exe...
Echo Echo Unpacking HP Driver Update IntelChipsetsp41388.exe... >> c:\driversupdate\MstExeLog.txt
START /wait C:\DriversUpdate\IntelChipsetsp41388.exe -e -s
Echo START /wait C:\DriversUpdate\IntelChipsetsp41388.exe -e -s >> c:\driversupdate\MstExeLog.txt

CLS
Echo CLS >> c:\driversupdate\MstExeLog.txt
start "" "C:\DriversUpdate\resplash.vbs"
Echo Unpacking HP Driver Update IntelPROWirelesssp44294.exe...
Echo Echo Unpacking HP Driver IntelPROWirelesssp44294.exe... >> c:\driversupdate\MstExeLog.txt
START /wait C:\DriversUpdate\IntelPROWirelesssp44294.exe -e -s
Echo START /wait C:\DriversUpdate\IntelPROWirelesssp44294.exe -e -s >> c:\driversupdate\MstExeLog.txt

CLS
start "" "C:\DriversUpdate\resplash.vbs"
Echo CLS >> c:\driversupdate\MstExeLog.txt
Echo Unpacking HP Driver Update Modemsp42851.exe...
Echo Echo Unpacking HP Driver Update Modemsp42851.exe... >> c:\driversupdate\MstExeLog.txt
START /wait C:\DriversUpdate\Modemsp42851.exe -e -s
Echo START /wait C:\DriversUpdate\Modemsp42851.exe -e -s >> c:\driversupdate\MstExeLog.txt

CLS
start "" "C:\DriversUpdate\resplash.vbs"
Echo CLS >> c:\driversupdate\MstExeLog.txt
Echo Unpacking HP Driver Update SOUNDsp42375.exe...
Echo Echo Unpacking HP Driver Update SOUNDsp42375.exe... >> c:\driversupdate\MstExeLog.txt
START /wait C:\DriversUpdate\SOUNDsp42375.exe -e -s
Echo START /wait C:\DriversUpdate\SOUNDsp42375.exe -e -s >> c:\driversupdate\MstExeLog.txt

CLS
start "" "C:\DriversUpdate\resplash.vbs"
Echo CLS >> c:\driversupdate\MstExeLog.txt
Echo Unpacking HP Driver Update SynapticTouchpadsp44921.exe...
Echo Echo Unpacking HP Driver Update SynapticTouchpadsp44921.exe... >> c:\driversupdate\MstExeLog.txt
START /wait C:\DriversUpdate\SynapticTouchpadsp44921.exe -e -s
Echo START /wait C:\DriversUpdate\SynapticTouchpadsp44921.exe -e -s >> c:\driversupdate\MstExeLog.txt

CLS
start "" "C:\DriversUpdate\resplash.vbs"
Echo CLS >> c:\driversupdate\MstExeLog.txt
Echo Unpacking HP Driver Update ATIVideosp43762.exe...
Echo Echo Unpacking HP Driver Update ATIVideosp43762.exe... >> c:\driversupdate\MstExeLog.txt
START /wait C:\DriversUpdate\ATIVideosp43762.exe -e -s
Echo START /wait C:\DriversUpdate\ATIVideosp43762.exe -e -s >> c:\driversupdate\MstExeLog.txt

CLS
start "" "C:\DriversUpdate\resplash.vbs"
Echo CLS >> c:\driversupdate\MstExeLog.txt
Echo Unpacking HP Driver Update IntelMatrixStoragesp45106.exe...
Echo Echo Unpacking HP Driver Update IntelMatrixStoragesp45106.exe... >> c:\driversupdate\MstExeLog.txt
START /wait C:\DriversUpdate\IntelMatrixStoragesp45106.exe -e -s
Echo START /wait C:\DriversUpdate\IntelMatrixStoragesp45106.exe -e -s >> c:\driversupdate\MstExeLog.txt

rem CLS
rem start "" "C:\DriversUpdate\resplash.vbs"
rem Echo CLS >> c:\driversupdate\MstExeLog.txt
rem Echo Unpacking HP Driver Update Camerasp39323.exe...
rem Echo Echo Unpacking HP Driver Update Camerasp39323.exe... >> c:\driversupdate\MstExeLog.txt
rem START /wait C:\DriversUpdate\Camerasp39323.exe -e -s
rem Echo START /wait C:\DriversUpdate\Camerasp39323.exe -e -s >> c:\driversupdate\MstExeLog.txt

@rem THIS KEEPS THE CAM DRIVER FROM GENERATING ERRORS
rem CLS
rem COPY /y C:\SWSetup\SP39323\Driver\csnp2uvc.dll c:\windows\system32\drivers
rem COPY /y C:\SWSetup\SP39323\Driver\rsnp2uvc.dll c:\windows\system32\drivers
rem COPY /y C:\SWSetup\SP39323\Driver\snp2TUI.dll c:\windows\system32\drivers
rem COPY /y C:\SWSetup\SP39323\Driver\vsnp2uvc.dll c:\windows\system32\drivers
rem COPY /y C:\SWSetup\SP39323\Driver\x64\sncduvc.sys c:\windows\system32\drivers
rem COPY /y C:\SWSetup\SP39323\Driver\x64\snp2uvc.sys c:\windows\system32\drivers

@rem INSTALLATION AREA
CLS
start "" "C:\DriversUpdate\resplash.vbs"
Echo CLS >> c:\driversupdate\MstExeLog.txt
Echo Installing HP Driver SP41388...
Echo Echo Installing HP Driver SP41388... >> c:\driversupdate\MstExeLog.txt
START /wait C:\SWSetup\SP41388\Setup.exe -s -nolic
Echo START /wait C:\SWSetup\SP41388\Setup.exe -s -nolic >> c:\driversupdate\MstExeLog.txt
ping 127.0.0.1 > nul
taskkill /f /im rundll32.exe
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt

@rem THIS STOPS THE CAM DRIVER FROM GENERATING ERRORS
CLS
COPY /y C:\SWSetup\SP41512\Driver\csnp2uvc.dll c:\windows\system32\drivers
COPY /y C:\SWSetup\SP41512\Driver\rsnp2uvc.dll c:\windows\system32\drivers
COPY /y C:\SWSetup\SP41512\Driver\snp2TUI.dll c:\windows\system32\drivers
COPY /y C:\SWSetup\SP41512\Driver\vsnp2uvc.dll c:\windows\system32\drivers
COPY /y C:\SWSetup\SP41512\Driver\x64\sncduvc.sys c:\windows\system32\drivers
COPY /y C:\SWSetup\SP41512\Driver\x64\snp2uvc.sys c:\windows\system32\drivers

CLS
start "" "C:\DriversUpdate\resplash.vbs"
Echo CLS >> c:\driversupdate\MstExeLog.txt
Echo Installing HP Driver SP41512...
Echo Echo Installing HP Driver SP41512... >> c:\driversupdate\MstExeLog.txt
START /wait C:\SWSetup\SP41512\setup.exe /s /a /s /sms /f1C:\DriversUpdate\SP41512setup.iss
Echo START /wait C:\SWSetup\SP41512\setup.exe /s /a /s /sms /f1C:\DriversUpdate\SP41512setup.iss >> c:\driversupdate\MstExeLog.txt
ping 127.0.0.1 > nul
taskkill /f /im rundll32.exe
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt

CLS
start "" "C:\DriversUpdate\resplash.vbs"
Echo CLS >> c:\driversupdate\MstExeLog.txt
Echo Installing HP Driver SP42375...
Echo Echo Installing HP Driver SP42375... >> c:\driversupdate\MstExeLog.txt
START /wait C:\SWSetup\SP42375\setup.exe /s /a /s /sms /f1C:\DriversUpdate\SP42375setup.iss
Echo START /wait C:\SWSetup\SP42375\setup.exe /s /a /s /sms /f1C:\DriversUpdate\SP42375setup.iss >> c:\driversupdate\MstExeLog.txt
ping 127.0.0.1 > nul
taskkill /f /im rundll32.exe
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt

CLS
start "" "C:\DriversUpdate\resplash.vbs"
Echo CLS >> c:\driversupdate\MstExeLog.txt
Echo Installing HP Driver SP42851...
Echo Echo Installing HP Driver SP42851... >> c:\driversupdate\MstExeLog.txt
START /wait C:\SWSetup\SP42851\setup.exe -s -A -s -sms
Echo START /wait C:\SWSetup\SP42851\setup.exe -s -A -s >> c:\driversupdate\MstExeLog.txt
ping 127.0.0.1 > nul
taskkill /f /im rundll32.exe
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt

CLS
start "" "C:\DriversUpdate\resplash.vbs"
Echo CLS >> c:\driversupdate\MstExeLog.txt
Echo Installing HP Driver SP44921...
Echo Echo Installing HP Driver SP44921... >> c:\driversupdate\MstExeLog.txt
START /wait C:\SWSetup\SP44921\Setup.exe -s -A -s -sms
Echo START /wait C:\SWSetup\SP44921\Setup.exe -s -A -s >> c:\driversupdate\MstExeLog.txt
ping 127.0.0.1 > nul
taskkill /f /im rundll32.exe
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt

CLS
start "" "C:\DriversUpdate\resplash.vbs"
Echo CLS >> c:\driversupdate\MstExeLog.txt
Echo Installing HP Driver ATI Control...
Echo Echo Installing HP Driver ATI Control... >> c:\driversupdate\MstExeLog.txt
START /wait C:\SWSetup\SP43762\issetup.exe -s -a -s -sms /f1C:\DriversUpdate\ATISoftSetup.iss
Echo START /wait C:\SWSetup\SP43762\issetup.exe -s -a -s -sms /f1C:\DriversUpdate\ATIFULLsetup.iss >> c:\driversupdate\MstExeLog.txt
Goto MONITOR2

:MONITOR2
@rem this wil monitor ATI Setup.exe process and wait if still running
TASKLIST /FI "IMAGENAME eq setup.exe" | find /i "setup.exe" && goto WAIT2
Echo TASKLIST /FI "IMAGENAME" >> c:\driversupdate\MstExeLog.txt
Goto NEXT2

:WAIT2
@ping 127.0.0.1 > nul
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt
Goto MONITOR2

:NEXT2
taskkill /f /im AtiCim.bin
Echo taskkill /f /im AtiCim.bin > nul >> c:\driversupdate\MstExeLog.txt
ping 127.0.0.1 > nul
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt
taskkill /f /im rundll32.exe
Echo taskkill /f /im rundll32.exe > nul >> c:\driversupdate\MstExeLog.txt


CLS
start "" "C:\DriversUpdate\resplash.vbs"
Echo CLS >> c:\driversupdate\MstExeLog.txt
Echo Installing HP Driver SP43762 ATI...
Echo Echo Installing HP Driver SP43762 ATI... >> c:\driversupdate\MstExeLog.txt
START /wait C:\SWSetup\SP43762\Driver\Setup.exe /s /a /s /sms
Echo START /wait C:\SWSetup\SP43762\Driver\Setup.exe /s /a /s /sms >> c:\driversupdate\MstExeLog.txt
ping 127.0.0.1 > nul
taskkill /f /im rundll32.exe
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt
Goto MONITOR3

:MONITOR3
@rem this wil monitor ATI Setup.exe process and wait if still running
TASKLIST /FI "IMAGENAME eq setup.exe" | find /i "setup.exe" && goto WAIT3
Echo TASKLIST /FI "IMAGENAME" >> c:\driversupdate\MstExeLog.txt
Goto NEXT3

:WAIT3
@ping 127.0.0.1 > nul
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt
Goto MONITOR3

:NEXT3
taskkill /f /im AtiCim.bin
ping 127.0.0.1 > nul
taskkill /f /im rundll32.exe
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt

CLS
start "" "C:\DriversUpdate\resplash.vbs"
Echo CLS >> c:\driversupdate\MstExeLog.txt
Echo Installing HP Driver SP43762 ATI Core Components...
Echo Echo Installing HP Driver SP43762... >> c:\driversupdate\MstExeLog.txt
START /wait C:\SWSetup\SP43762\CCC\setup.exe /s /a /a f1C:\SWSetup\SP43762\CCC\setup.iss
Echo START /wait C:\SWSetup\SP43762\CCC\setup.exe /s /a /a f1C:\SWSetup\SP43762\CCC\setup.iss >> c:\driversupdate\MstExeLog.txt
ping 127.0.0.1 > nul
taskkill /f /im rundll32.exe
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt
Goto MONITOR4

:MONITOR4
@rem this wil monitor ATI Setup.exe process and wait if still running
TASKLIST /FI "IMAGENAME eq setup.exe" | find /i "setup.exe" && goto WAIT4
Echo TASKLIST /FI "IMAGENAME" >> c:\driversupdate\MstExeLog.txt
Goto NEXT4

:WAIT4
@ping 127.0.0.1 > nul
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt
Goto MONITOR4

:NEXT4
taskkill /f /im AtiCim.bin
ping 127.0.0.1 > nul
taskkill /f /im rundll32.exe
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt

CLS
start "" "C:\DriversUpdate\resplash.vbs"
Echo CLS >> c:\driversupdate\MstExeLog.txt
Echo Installing HP Driver SP44294...
Echo Echo Installing HP Driver SP44294... >> c:\driversupdate\MstExeLog.txt
START /wait C:\SWSetup\sp44294\iProDifX.exe /silent /install
Echo START /wait C:\SWSetup\sp44294\iProDifX.exe /silent /install >> c:\driversupdate\MstExeLog.txt
ping 127.0.0.1 > nul
taskkill /f /im rundll32.exe
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt

CLS
start "" "C:\DriversUpdate\resplash.vbs"
Echo CLS >> c:\driversupdate\MstExeLog.txt
Echo Installing HP Driver SP44777...
Echo Echo Installing HP Driver SP44777... >> c:\driversupdate\MstExeLog.txt
START /wait C:\SWSetup\SP44777\Disk1\setup.exe /s /a /s /sms /f1C:\DriversUpdate\SP44777setup.iss
Echo START /wait C:\SWSetup\SP44777\Disk1\setup.exe /s /a /s /sms /f1C:\DriversUpdate\SP44777setup.iss >> c:\driversupdate\MstExeLog.txt
ping 127.0.0.1 > nul
taskkill /f /im rundll32.exe
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt

CLS
start "" "C:\DriversUpdate\resplash.vbs"
Echo CLS >> c:\driversupdate\MstExeLog.txt
Echo Installing HP Driver SP45622...
Echo Echo Installing HP Driver SP45622... >> c:\driversupdate\MstExeLog.txt
START /wait C:\SWSetup\SP45622\Setup.exe -s -A -s -sms
Echo START /wait C:\SWSetup\SP45622\Setup.exe -s -A -s -sms >> c:\driversupdate\MstExeLog.txt
ping 127.0.0.1 > nul
taskkill /f /im rundll32.exe
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt

CLS
start "" "C:\DriversUpdate\resplash.vbs"
Echo CLS >> c:\driversupdate\MstExeLog.txt
Echo Installing HP Driver SP45106...
Echo Echo Installing HP Driver SP45106... >> c:\driversupdate\MstExeLog.txt
START /wait C:\SWSetup\SP45106\Setup.exe -s
Echo START /wait C:\SWSetup\SP45106\Setup.exe -s >> c:\driversupdate\MstExeLog.txt
ping 127.0.0.1 > nul
taskkill /f /im rundll32.exe
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt

@rem THIS WILL INSTALL SYMANTEC AV 11 4204
start "" "C:\DriversUpdate\sep11\setup.exe" /s /qn
Echo start "" "C:\DriversUpdate\sep11\setup.exe" /s /qn >> c:\driversupdate\MstExeLog.txt
ping 127.0.0.1 > nul
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt
Echo Goto MONITOR1 >> c:\driversupdate\MstExeLog.txt

:MONITOR1
@rem this wil monitor setup.exe process and wait if still running
TASKLIST /FI "IMAGENAME eq setup.exe" | find /i "setup.exe" && goto WAIT1
Echo TASKLIST /FI "IMAGENAME" >> c:\driversupdate\MstExeLog.txt
Goto ENCRYPTION

:WAIT1
@ping 127.0.0.1 > nul
Echo ping 127.0.0.1 > nul >> c:\driversupdate\MstExeLog.txt
Goto MONITOR1

:ENCRYPTION
start "" "C:\DriversUpdate\resplash.vbs"
Echo Goto ENCRYPTION >> c:\driversupdate\MstExeLog.txt
@rem THIS WILL INSTALL ENCRYPTION
start /wait c:\DriversUpdate\ENCRYPTION\ENCRYPTION.exe
Echo start /wait c:\DriversUpdate\ENCRYPTION\ENCRYPTION.exe >> c:\driversupdate\MstExeLog.txt
RMDIR "c:\Documents and Settings\All Users\Start Menu\Programs\ENCRYPTION"
Echo RMDIR "c:\Documents and Settings\All Users\Start Menu\Programs\ENCRYPTION" >> c:\driversupdate\MstExeLog.txt

@taskkill /f /im mshta.exe
Echo @taskkill /f /im mshta.exe >> c:\driversupdate\MstExeLog.txt

@rem CREATES A POPUP FOR END-USER
Echo popup = msgbox("Installation is complete! Press the OK button to restart your workstation.",,"HP Updates") > %temp%\popup.vbs
Echo Echo popup = msgbox("Installation is complete! Press the OK button to restart your workstation.",,"HP Updates") > %temp%\popup.vbs >> c:\driversupdate\MstExeLog.txt
Start /wait %temp%\popup.vbs
Echo Start /wait %temp%\popup.vbs >> c:\driversupdate\MstExeLog.txt

@rem BEGINS SHUTDOWN SEQUENCE
@taskkill /f /im psexecsvc.exe
Echo taskkill /f /im psexecsvc.exe >> c:\driversupdate\MstExeLog.txt
@taskkill /f /im iexplore.exe
Echo taskkill /f /im iexplore.exe >> c:\driversupdate\MstExeLog.txt
@taskkill /f /im outlook.exe
Echo taskkill /f /im outlook.exe >> c:\driversupdate\MstExeLog.txt
@taskkill /f /im winword.exe
Echo taskkill /f /im winword.exe >> c:\driversupdate\MstExeLog.txt
@taskkill /f /im excel.exe
Echo taskkill /f /im excel.exe >> c:\driversupdate\MstExeLog.txt
@taskkill /f /im communicator.exe
Echo taskkill /f /im communicator.exe >> c:\driversupdate\MstExeLog.txt
@taskkill /f /im hpqtoaster.exe
Echo taskkill /f /im hpqtoaster.exe >> c:\driversupdate\MstExeLog.txt
@net start wuauserv
echo start wuauserv >> c:\driversupdate\MstExeLog.txt
Echo Exit >> c:\driversupdate\MstExeLog.txt
shutdown -f -r -t 1
exit


bar1
bar1

 

 

 

 

Δ Query Symantec 4000 & 4202 Versions On Network

bar1

How do you run a query on all network workstations and output the results to comma delimted text?  The first order of business is obtaining a list of all workstations on the network. There are several ways of doing this. Piping [net view] to a text file is quick and easy (command: net view > textfile.txt). Then we want to somehow cycle through our workstation list, outputing version condition 1 and version condition 2 to a text file. Finally, we want to output the offline condition to a separate text which can be used later as a new workstation list.


bar1
   Here are our specs:




Query all workstations on network
Report version 4000 to log
Report version 4202 to log
Report offline machines to separate log
To be coded in 1 day

bar1


@rem ***********************************************************
@rem Script Language: Shell
@rem Script Name: Query.cmd
@rem Purpose: To query Symantec AV Versions
@rem Creation Date: 10/20/09
@rem Last Modified:
@rem Directions: double-click the Query.cmd
@rem Author: Eddie Jackson
@rem Email:
MrNetTek@gmail.com
@rem ***********************************************************

@color 0a
@title=Querying Symantec AV 11 Versions...

@ECHO OFF
@echo off > C:\Queries\SymantecVersions\Symantec_LIST_Offline.txt

@echo off > C:\Queries\SymantecVersions\Symantec_LIST.TXT
setLocal EnableDelayedExpansion

for /f "tokens=* delims= " %%a in (C:\Queries\SymantecVersions\computers.txt) do (
ping %%a | find "Reply" > nul

if errorlevel 1 (echo %%a, OFFLINE >> C:\Queries\SymantecVersions\Symantec_LIST_Offline.txt & echo %%a OFFLINE
) else (

IF EXIST "\\%%a\C$\Program Files\Symantec\Symantec Endpoint Protection\devman.plg" (ECHO %%a 4202) & (ECHO %%a,4202 >> C:\ScriptRepository\Queries\SymantecVersions\Symantec_LIST.TXT)

@rem IF EXIST "\\%%a\c$\Program Files\Symantec\Symantec Endpoint Protection\Teefer2.cat" (ECHO %%a 4202) & (ECHO %%a,4202 >> C:\Queries\SymantecVersions\Symantec_LIST.TXT)

IF NOT EXIST "\\%%a\C$\Program Files\Symantec\Symantec Endpoint Protection\devman.plg" (ECHO %%a 4000) & (ECHO %%a,4000 >> C:\Queries\SymantecVersions\Symantec_LIST.TXT)
)
)
pause
exit


bar1
bar1






Δ Remotely Install Symantec AV - Cycling Through Text File
bar1



I am tasked with installing Symantec 11 update to a list of workstations.


bar1
  
   Here are our specs:






To remotely & silently install Symantec AV 11
Cycle through list of workstations
Report deployment to remote log
Report completed installations to remote log
Report script execution to local event log
Create animated progress/busy HTA
To be coded in 7 days

bar1

'==================================================
'L A N G U A G E
'VBScript
'
'S C R I P T N A M E
'_deploypackage.VBS
'
'P U R P O S E
'To remotely, silently install Symantec Anti-Virus 11 cycling through a workstation list.
'
'U S A G E
'Create workstation list in text file workstation_list.txt. Execute script. Script will pull on workstation name at a time.
'
'A U T H O R
'Eddie S. Jackson
'
'D A T E C R E A T E D
'10/19/09
'
'D A T E M O D I F I E D
'
'
'D E S C R I P T I O N
'
'
'C O M M E N T S
'
'==================================================

'DEFINE VARIABLES
'--------------------------------------------------------------------------------------------
Option Explicit
DIM strCopyFile, objFSO, objShell, objFile, strCommand, objNetwork, strPSUserName, strDesc, objWSHShell
DIM boolRC, strWorkstationList, strInstall_Cmd, strCopyPath, strPSPassword, strWorkstation, oWshShell
DIM WMIServices, objUserset, User, strLoggedUN, strCopyFile1, strDescr, strOpenWorkstationList, wShell, strUsername
DIM objLogFile1, strDeployedLog, ComputerName, strLoadProgressbar, strEndtask1, strEndtask2, popup
DIM intAnswer, strEVTUserName

strWorkstationList = "workstation_list.txt" 'WORKSTATION LIST
strInstall_Cmd = "install.cmd"
strCopyPath = "c:\windows\system32\"
strPSUsername = "administrator"
strPSPassword = ""
strDeployedLog = "C:\ScriptRepository\Symantec11\Logs\deployed.txt"
strLoadProgressbar = "progressbar.hta"

'INSTANTIATE OBJECTS
set wShell = CreateObject("Wscript.Shell")
set objShell = CreateObject("Wscript.Shell")
set objFSO = CreateObject("Scripting.FileSystemObject")
set objFile = objFSO.OpenTextFile(strWorkstationList)

'SETTINGS FOR EVENT LOG
Const EVENT_SUCCESS = 0
Const EVENT_ERROR = 1
Const EVENT_WARNING = 3
Const EVENT_INFO = 4
Const ForAppending1 = 8
'---------------------------------------------------------------------------------------------


'M A I N  R O U T I N E
'---------------------------------------------------------------------------------------------

'Are you sure YES or NO routine
intAnswer = _
Msgbox("Are you sure you want to execute the Symantec Update Script?", _
vbYesNo, "Symantec Update Script")
If intAnswer = vbYes Then

'THIS FLUSHES CACHES
objShell.Run "%comspec% /c ipconfig /flushdns",0, True
objShell.Run "%comspec% /c nbtstat -RR",0, True
objShell.Run "%comspec% /c netsh interface ip delete arpcache",0, True

'THIS CLEARS PROCESSES BEFORE LOOP BEGINS
strEndtask1 = "%comspec% /c taskkill.exe /f /im psexecsvc.exe"
objShell.Run strEndtask1, 0, False

strEndtask2 = "%comspec% /c taskkill.exe /f /im mshta.exe"
objShell.Run strEndtask2, 0, False

'THIS IS THE POP UP FOR USER TO CHECK WORKSTATION LIST
popup = msgbox("Verify the workstation list...close the list when you're ready to proceed.",,"Symantec Update Script")

'THIS OPENS THE WORKSTATION LIST
strOpenWorkstationList = "notepad.exe workstation_list.txt"
objShell.Run strOpenWorkstationList, 9, True

'THIS LOADS THE PROGRESS BAR
objShell.Run strLoadProgressbar

'THIS SETS UP LOOP
Do while not objFile.AtEndOfStream

'THIS READS A SINGLE WORKSTATION NAME INTO A VARIABLE
strWorkstation = objFile.Readline

'This creates the object
Set objFSO = CreateObject("Scripting.FileSystemObject")

'THIS SETS THE LOG TO BE APPENDED TO

Set objLogFile1 = objFSO.OpenTextFile(strDeployedLog, ForAppending1, True)
''''WScript.Echo "Workstation name: " & strWorkstation

Set oWshShell = CreateObject("Wscript.Shell")
WMIServices = "winmgmts:{impersonationLevel=impersonate}!//"& strWorkstation &""
On Error Resume Next
Set objUserSet = GetObject( WMIServices ).InstancesOf ("Win32_ComputerSystem")
If Err.number <> 0 Then
If Err.Number = "-2147217405" Then
''''''oWshShell.Popup "Access Denied", 10, strWorkstation, 48

'THIS WRITES TO REMOTE LOG
Set objNetwork = CreateObject("WScript.Network")
objLogFile1.WriteLine Date() & " " & Time() & "," & strWorkstation & "," & objNetwork.UserName & "," & "Symantec Anti-Virus 11" & "," & "Access Denied"

'THIS CLOSES THE INPUT

objLogFile1.Close

ElseIf Err.Number = "462" Then
''''''oWshShell.Popup "Host Unreachable", 10, strWorkstation, 48

'THIS WRITES TO REMOTE LOG
Set objNetwork = CreateObject("WScript.Network")
objLogFile1.WriteLine Date() & " " & Time() & "," & strWorkstation & "," & objNetwork.UserName & "," & "Symantec Anti-Virus 11" & "," & "Host Unreachable"

'THIS CLOSES THE INPUT
objLogFile1.Close

Else
''''''oWshShell.Popup "Computer does not respond. " & Err.Number, 10, strWorkstation, 48
'THIS WRITES TO LOG
Set objNetwork = CreateObject("WScript.Network")
objLogFile1.WriteLine Date() & " " & Time() & "," & strWorkstation & "," & objNetwork.UserName & "," & "Symantec Anti-Virus 11" & "," & "Computer does not respond"
'THIS CLOSES THE INPUT
objLogFile1.Close

End If
'wScript.Quit
objLogFile1.Close
End If
for each User in objUserSet

'THIS WILL EXECUTE IF USERNAME DOES NOT EQUAL EMPTY
If User.UserName <> "" Then
'oWshShell.Popup "The current user on " & strWorkstation & " is: " & User.UserName, 10, strWorkstation, 64
strLoggedUN = User.UserName
''''WScript.Echo strLoggedUN
''''WScript.Echo User.UserName

'THIS WILL COPY THE COMMAND.CMD FILE FROM SOURCE TO TARGET
strCopyFile1 = "%COMSPEC% /c copy /y" & " " & strInstall_Cmd & " " & "\\" & strWorkstation & "\" & strCopyPath
objShell.Run strCopyFile1, 0, True

'THIS WILL REMOTELY EXECUTE THE COMMAND.CMD FILE
'WScript.Echo strWorkstation
strCommand = "psexec \\"& strWorkstation & " -u " & strPSUsername & " -p " & strPSPassword & " -d " & strInstall_Cmd
'WScript.Echo strCommand
objShell.Run strCommand, 0, True

'THIS WRITES TO LOCAL LOG
' ------ BEGIN LOCAL EVENT LOG ------
Set objNetwork = CreateObject("WScript.Network")
strEVTUserName = objNetwork.UserName
strDescr = "Symantec Anti-Virus 11 Installed by " & strEVTUserName
set objWSHShell = Wscript.CreateObject("Wscript.Shell")
boolRC = objWSHShell.LogEvent(EVENT_SUCCESS, strDescr, strWorkstation)
' ------ END LOCAL EVENT LOG ---------

'THIS WRITES TO REMOTE LOG
Set objNetwork = CreateObject("WScript.Network")
objLogFile1.WriteLine Date() & " " & Time() & "," & strWorkstation & "," & objNetwork.UserName & "," & "Symantec Anti-Virus 11" & "," & "Deployed/Pending" & "," & strLoggedUN
'THIS CLOSES THE INPUT
objLogFile1.Close

Else
'oWshShell.Popup "There are no users currently logged in at " & strWorkstation, 10, strWorkstation, 64

'THIS WRITES TO REMOTE LOG
Set objNetwork = CreateObject("WScript.Network")
objLogFile1.WriteLine Date() & " " & Time() & "," & strWorkstation & "," & objNetwork.UserName & "," & "Symantec Anti-Virus 11" & "," & "No user is logged on"
'THIS CLOSES THE INPUT
objLogFile1.Close

End If

WScript.Sleep 2000
objShell.Run "%comspec% /c ipconfig /flushdns",0, True
objShell.Run "%comspec% /c nbtstat -RR",0, True
objShell.Run "%comspec% /c netsh interface ip delete arpcache",0, True

Next

Loop
else

'THIS CLEANS UP PROCESSES AND EXITS
strEndtask1 = "%comspec% /c taskkill.exe /f /im psexecsvc.exe"
objShell.Run strEndtask1, 0, False

strEndtask2 = "%comspec% /c taskkill.exe /f /im mshta.exe"
objShell.Run strEndtask2, 0, False
popup = msgbox("Symantec Update Script cancelled!",,"Symantec Update Script")
WScript.Quit


bar1

bar1





Δ Restrict Guest Access To Logs  
bar1

Guests are by default allowed to access the Event Logs of a machine (Even over the network).
The are 3 event logs on a machine Application-, Security- and System-EventLog.


To block guest access to the EventLogs set the following DWORD keys
(Blocked by default on Windows XP/2003):

[HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \EventLog \Application]
[HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \EventLog \System]
[HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \EventLog \Security]
RestrictGuestAccess = 1 (0 = Enable Guest Access, 1 = Disable Guest Access

bar1
bar1

 

 

 

Δ PING List Of Computers
bar1



Ping workstations and output data to log.

bar1

   Here are our specs:



PING workstation
Cycle through list of workstations
Output results to log
To be coded in 1 day

bar1

@echo off

(Set InputFile=c:\workstations.txt)

title,Pinging list of computers &color 9e

::datestamp
for /f "tokens=2-4 skip=1 delims=(-./)" %%i in ('echo.^|date') do (
for /f "tokens=1-4 delims=-./ " %%m in ('date /t') do (
(set dow=%%m)&(set %%i=%%n)&(set %%j=%%o)&(set yy=%%p) ) )
For /F "tokens=1,2 delims=:, " %%i in ('TIME /T') Do (Set HHMM=%%i%%j)

(Set OutputFile=c:\Pinglog %yy%-%mm%-%dd% %HHMM%.txt)  

If Exist "%OutputFile%" Del "%OutputFile%

 For /F "eol=;" %%* in ('type "%InputFile%"') do (>>"%OutputFile%" (echo.&echo.---------------&(echo.%%*;&(ping -a -n 2 -w 750 %%* | Find "."))
)&echo.done %%*,)

::check
start notepad.exe %OutputFile%

bar1
bar1

 

 



 

 

 


 

 


  About

  
I'm a Computer
  
Systems Engineer

  
Living and loving life
........................................


 
Author


 .