Archive - August 2010
"The
mind is everything. What you think you become." - Buddha
Index
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Δ
Tuesday, August 31th 2010
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Δ
Iron Mountain Deployment With OS Detection
How to deploy iron mountain software to your enterprise
VBScript:
Install
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
'::
******************************************************************************
':: SCRIPT LANGUAGE: VBScript ':: SCRIPT NAME: IronMountainInstall.vbs '::
PURPOSE: To be used to Install Iron Mountain ':: CREATION DATE: 09/01/2010
':: LAST MODIFIED: ':: DIRECTIONS: Send to client workstation from LANDesk
':: AUTHOR: Eddie Jackson ':: EMAIL: MrNetTek2000@yahoo.com '::
*****************************************************************************
on error resume next Dim filesys, strComputer, OSDetect, objWMIService,
colInstances, sUser, strUser, objShell
set filesys =
createobject("scripting.filesystemobject") FilterFile = "c:\Program
Files\Iron Mountain\Connected BackupPC\Agent.exe" If
filesys.FileExists(FilterFile) THEN WScript.Quit(0) End if
strComputer = "."
'If UserLoggedInStatus = TRUE then msgbox "user IS
logged in" If UserLoggedInStatus() = FALSE then 'msgbox "user NOT logged
in" WScript.Quit(140) end if
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
Set objWMIService =
GetObject("winmgmts://" & strComputer & "/root/CIMV2" ) Set colInstances =
objWMIService.ExecQuery( "SELECT * FROM Win32_OperatingSystem", "WQL",
wbemFlagReturnImmediately + wbemFlagForwardOnly )
For Each objInstance In
colInstances on error resume next 'msgbox objInstance.Caption OSDetect
= objInstance.Caption Next
if OSDetect = "Microsoft Windows XP
Professional" then XP() if objInstance.Caption = "Microsoft Windows 7
Enterprise" then Seven() if objInstance.Caption <> "Microsoft Windows 7
Enterprise" then XP()
'W I N D O W S X P Sub XP
on error
resume next sUser = ConsoleUser(".") strUser = Trim(sUser)
'MsgBox
sUser
Set objShell = CreateObject("WScript.Shell") 'TEMPORARILY
TURNS OFF AUTOMATIC UPDATES objShell.Run "cmd /c net stop wuauserv",0,True
'Install objShell.Run "cmd /c md " & chr(34) & "%ProgramFiles%\Iron Mountain"
& chr(34),0,True objShell.Run "c:\windows\system32\cacls.exe" & " " & chr(34)
& "%ProgramFiles%\Iron Mountain" & chr(34) & " " & "/e /g everyone:f",0,True
objShell.Run "cmd /c md " & chr(34) & "%ProgramFiles%\Iron Mountain\Connected
BackupPC" & chr(34),0,True 'objShell.Run "extract.exe",9,True objShell.Run
"c:\windows\system32\cacls.exe" & " " & chr(34) & "%ProgramFiles%\Iron
Mountain\Connected BackupPC" & chr(34) & " " & "/e /g everyone:f",0,True
'INSTALLS IRON MOUNTAIN Install = "cmd /c
c:\windows\system32\msiexec.exe /qn /i "& CHR(34) & "PCAgentSetup8408.msi" &
CHR(34) & " FIRSTBACKUP=0 LDAPID=" & strUser 'msgbox Install Err.Number =
objShell.Run (Install,0,True) 'WScript.Quit(0)
'ACTIVATES/REGISTERS
ACCOUNT WITH IRON MOUNTAIN Activate = "cmd /c " & chr(34) & "c:\Program
Files\Iron Mountain\Connected BackupPC\Activate.exe" & chr(34) & " " & "-ldapid
" & strUser & " -registernow" 'msgbox Activate objShell.Run
Activate,0,True
'WAITS FOR ACTIVATION TO FINISH WScript.Sleep 2000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True
'TURNS ON
AUTOMATIC UPDATES objShell.Run "cmd /c net start wuauserv",0,True
if
Err.Number = 3010 then Err.Number = 0 WScript.Quit(Err.Number) End Sub
'W I N D O W S 7 Sub SEVEN() on error resume next sUser =
ConsoleUser(".") strUser = Trim(sUser)
'MsgBox sUser
Set
objShell = CreateObject("WScript.Shell") 'TEMPORARILY TURNS OFF AUTOMATIC
UPDATES objShell.Run "cmd /c net stop wuauserv",0,True 'Install
objShell.Run "cmd /c md " & chr(34) & "%ProgramFiles%\Iron Mountain" &
chr(34),0,True objShell.Run "c:\windows\system32\cacls.exe" & " " & chr(34) &
"%ProgramFiles%\Iron Mountain" & chr(34) & " " & "/e /g everyone:f",0,True
objShell.Run "cmd /c md " & chr(34) & "%ProgramFiles%\Iron Mountain\Connected
BackupPC" & chr(34),0,True 'objShell.Run "extract.exe",9,True objShell.Run
"c:\windows\system32\cacls.exe" & " " & chr(34) & "%ProgramFiles%\Iron
Mountain\Connected BackupPC" & chr(34) & " " & "/e /g everyone:f",0,True
'INSTALLS IRON MOUNTAIN Install = "cmd /c
c:\windows\system32\msiexec.exe /qn /i "& CHR(34) & "PCAgentSetup8408.msi" &
CHR(34) & " FIRSTBACKUP=0 LDAPID=" & strUser 'msgbox Install Err.Number =
objShell.Run (Install,0,True) 'WScript.Quit(0)
'ACTIVATES/REGISTERS
ACCOUNT WITH IRON MOUNTAIN Activate = "cmd /c " & chr(34) & "c:\Program
Files\Iron Mountain\Connected BackupPC\Activate.exe" & chr(34) & " " & "-ldapid
" & strUser & " -registernow" 'msgbox Activate objShell.Run
Activate,0,True
'WAITS FOR ACTIVATION TO FINISH WScript.Sleep 2000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True WScript.Sleep 1000
objShell.Run "cmd /c taskkill.exe /f /im agent.exe",0,True
'TURNS ON
AUTOMATIC UPDATES objShell.Run "cmd /c net start wuauserv",0,True
if
Err.Number = 3010 then Err.Number = 0 WScript.Quit(Err.Number) End Sub
'THIS FUNCTION RETURNS OWNER OF EXPLORER.EXE PROCESS Function
ConsoleUser(sHost) on error resume next ' Returns name of user logged on
to console ' If no users are logged on, returns "" Dim oWMI, colProc,
oProcess, sUser, sDomain Set oWmi = GetObject("winmgmts:" _ &
"{impersonationLevel=impersonate,(debug)}!\\" _ & sHost & "\root\cimv2" )
Set colProc = oWmi.ExecQuery("Select Name from Win32_Process" _ & "
Where Name='explorer.exe' and SessionID=0" )
ConsoleUser = "" For
Each oProcess In colProc lRet = oProcess.GetOwner(sUser, sDomain) If
lRet = 0 Then ConsoleUser = sUser End If Next End Function
Function UserLoggedInStatus() Dim LoggedInStatus, objWMIService,
colItems
'Example 'strComputer = "." 'If UserLoggedInStatus = TRUE
then msgbox "user IS logged in" 'If UserLoggedInStatus = FALSE then msgbox
"user NOT logged in"
Set objWMIService = GetObject("winmgmts:\\" &
strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select *
from Win32_ComputerSystem",,48)
For Each objItem in colItems
'Wscript.Echo objItem.UserName LoggedInStatus = trim(objItem.UserName) & ""
next
if LoggedInStatus = "" then 'msgbox "User NOT logged in"
UserLoggedInStatus = FALSE end if
if LoggedInStatus <> "" then
'msgbox "User IS logged in" UserLoggedInStatus = TRUE end if
Set
objItem = Nothing Set colItems = Nothing Set objWMIService = Nothing
End function
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Δ
Symantec Vault Deployment With OS Detection
How to deploy vault to your enterprise
VBScript:
Install
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
'::
*************************************************************************
':: SCRIPT LANGUAGE: VBScript ':: SCRIPT NAME: Install.vbs ':: PURPOSE: To
be used to Install Vault ':: CREATION DATE: 08/31/2010 ':: LAST MODIFIED:
':: DIRECTIONS: Send to client workstation ':: AUTHOR: Eddie Jackson
':: EMAIL: MrNetTek2000@yahoo.com '::
**************************************************************************
On error resume next Dim strComputer, OSDetect, objWMIService,
colInstances
strComputer = "."
Const wbemFlagReturnImmediately =
&h10 Const wbemFlagForwardOnly = &h20
Set objWMIService =
GetObject("winmgmts://" & strComputer & "/root/CIMV2" ) Set colInstances =
objWMIService.ExecQuery( "SELECT * FROM Win32_OperatingSystem", "WQL",
wbemFlagReturnImmediately + wbemFlagForwardOnly )
For Each objInstance In
colInstances
'msgbox objInstance.Caption OSDetect =
objInstance.Caption Next
if OSDetect = "Microsoft Windows XP
Professional" then XP() if objInstance.Caption = "Microsoft Windows 7
Enterprise" then Seven() if objInstance.Caption <> "Microsoft Windows 7
Enterprise" then XP()
'W I N D O W S X P Sub XP on error resume
next DIM objShell Set objShell = CreateObject("WScript.Shell")
objShell.Run "cmd /c net stop wuauserv",0,True 'Install Err.Number =
objShell.Run ("cmd /c c:\windows\system32\msiexec.exe /qn /i "&CHR(34)&"Symantec
Enterprise Vault Outlook Add-in-en.msi"&CHR(34)&" /qn /norestart",0,True)
objShell.Run "cmd /c net start wuauserv",0,True if Err.Number = 3010 then
Err.Number = 0 WScript.Quit(Err.Number) End Sub
'W I N D O W S
7 Sub SEVEN() on error resume next DIM objShell Set objShell =
CreateObject("WScript.Shell") objShell.Run "cmd /c net stop wuauserv",0,True
'Install Err.Number = objShell.Run ("cmd /c c:\windows\system32\msiexec.exe
/qn /i "&CHR(34)&"Symantec Enterprise Vault Outlook Add-in-en.msi"&CHR(34)&" /qn
/norestart",0,True) objShell.Run "cmd /c net start wuauserv",0,True if
Err.Number = 3010 then Err.Number = 0 WScript.Quit(Err.Number) End Sub
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
VBScript:
Uninstall
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
'::
*************************************************************************
':: SCRIPT LANGUAGE: VBScript ':: SCRIPT NAME: UnInstall.vbs ':: PURPOSE:
To be used to UnInstall Vault ':: CREATION DATE: 08/31/2010 ':: LAST
MODIFIED: ':: DIRECTIONS: Send to client workstation ':: AUTHOR: Eddie
Jackson ':: EMAIL: MrNetTek2000@yahoo.com '::
*************************************************************************
On error resume next Dim strComputer, OSDetect, objWMIService,
colInstances
strComputer = "."
Const wbemFlagReturnImmediately =
&h10 Const wbemFlagForwardOnly = &h20
Set objWMIService =
GetObject("winmgmts://" & strComputer & "/root/CIMV2" ) Set colInstances =
objWMIService.ExecQuery( "SELECT * FROM Win32_OperatingSystem", "WQL",
wbemFlagReturnImmediately + wbemFlagForwardOnly )
For Each objInstance In
colInstances
'msgbox objInstance.Caption OSDetect =
objInstance.Caption Next
if OSDetect = "Microsoft Windows XP
Professional" then XP() if objInstance.Caption = "Microsoft Windows 7
Enterprise" then Seven() if objInstance.Caption <> "Microsoft Windows 7
Enterprise" then XP()
'W I N D O W S X P Sub XP on error resume
next DIM objShell Set objShell = CreateObject("WScript.Shell")
objShell.Run "cmd /c net stop wuauserv",0,True 'Uninstall Err.Number =
objShell.Run ("c:\windows\system32\msiexec.exe /qn /x "&CHR(34)&"
Symantec
Enterprise Vault Outlook Add-in-en.msi"&CHR(34)&" /qn /norestart",0,True)
objShell.Run "cmd /c net start wuauserv",0,True if Err.Number = 3010 then
Err.Number = 0 WScript.Quit(Err.Number) End Sub
'W I N D O W S
7 Sub SEVEN() on error resume next DIM objShell Set objShell =
CreateObject("WScript.Shell") objShell.Run "cmd /c net stop wuauserv",0,True
'Uninstall Err.Number = objShell.Run ("c:\windows\system32\msiexec.exe
/qn /x "&CHR(34)&" Symantec Enterprise Vault Outlook Add-in-en.msi"&CHR(34)&" /qn
/norestart",0,True) objShell.Run "cmd /c net start wuauserv",0,True if
Err.Number = 3010 then Err.Number = 0 WScript.Quit(Err.Number) End Sub
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Δ
Monday, August 30th 2010
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Δ
VBScript objShell Run Codes
How to use the objShell.Run codes effectively
VBScript: Integer Window Style Description
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
0 Hides the window and activates another window.
1 Activates and displays a window. If the window is
minimized or maximized, the system restores it to its original size and
position. An application should specify this flag when displaying the window for
the first time.
2 Activates the window and displays
it as a minimized window.
3 Activates the window and
displays it as a maximized window.
4 Displays a
window in its most recent size and position. The active window remains active.
5 Activates the window and displays it in its current
size and position.
6 Minimizes the specified window
and activates the next top-level window in the Z order. The Z order is nothing
more than the list detailing the order in which windows are to be activated. If
you press ALT+TAB, you will see a graphical representation of the Z list.
7 Displays the window as a minimized window. The active
window remains active.
8 Displays the window in its
current state. The active window remains active.
9
Activates and displays the window. If the window is minimized or maximized, the
system restores it to its original size and position. An application should
specify this flag when restoring a minimized window.
10
Sets the show-state based on the state of the program that started the
application.
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Δ
Office 2007 Error Code Export To Text File
How to start office 2007 setup and export errorcode to
text file to be imported by the cmd file
VBScript
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
on error resume next DIM forWriting, Overwrite, objShell
Set objShell
= CreateObject("WScript.Shell") Set objFSO =
CreateObject("Scripting.FileSystemObject")
objShell.Run "cmd /c
echo.>c:\windows\temp\OfficeCode.txt",0, True
ErrorLevel = objShell.Run
("setup.exe",2,True)
forWriting = 2 Overwrite = True
Set
objErrorCode = objFSO.OpenTextFile("c:\windows\temp\OfficeCode.txt", 2, True)
objErrorCode.WriteLine ErrorLevel objErrorCode.Close WScript.Quit
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Δ
Installing Office 2007 Client-Side
How to allow end-user to pull installation, handle
errorcodes and splash screen
Shell
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
@echo on ::
**************************************************************************
:: SCRIPT LANGUAGE: Shell :: SCRIPT NAME: :: PURPOSE: T :: Also
launches splash screen to interact with end-user :: CREATION DATE: 08/24/2010
:: LAST MODIFIED: :: DIRECTIONS: Send to client workstation :: AUTHOR:
Eddie Jackson :: EMAIL: MrNetTek2000@yahoo.com ::
**************************************************************************
::INITIAL FILTERS ::TEST IF OFFICE2007 ALREADY EXISTS if exist
"%ProgramFiles%\Microsoft Office\Office12\WINWORD.EXE" goto END
::VERIFY
OFFICE APPLICATIONS ARE NOT CURRENTLY OPEN start /b /wait /LOW
c:\windows\system32\TASKLIST.exe /FI "IMAGENAME eq OUTLOOK.EXE" | find /i
"OUTLOOK.EXE" && (goto KILL1) start /b /wait /LOW
c:\windows\system32\TASKLIST.exe /FI "IMAGENAME eq WINWORD.EXE" | find /i
"WINWORD.EXE" && (goto KILL1) start /b /wait /LOW
c:\windows\system32\TASKLIST.exe /FI "IMAGENAME eq EXCEL.EXE" | find /i
"EXCEL.EXE" && (goto KILL1) start /b /wait /LOW
c:\windows\system32\TASKLIST.exe /FI "IMAGENAME eq POWERPNT.EXE" | find /i
"POWERPNT.EXE" && (goto KILL1) start /b /wait /LOW
c:\windows\system32\TASKLIST.exe /FI "IMAGENAME eq ONENOTE.EXE" | find /i
"ONENOTE.EXE" && (goto KILL1) start /b /wait /LOW
c:\windows\system32\TASKLIST.exe /FI "IMAGENAME eq MSACCESS.EXE" | find /i
"MSACCESS.EXE" && (goto KILL1) start /b /wait /LOW
c:\windows\system32\TASKLIST.exe /FI "IMAGENAME eq INFOPATH.EXE" | find /i
"INFOPATH.EXE" && (goto KILL1) || goto MAIN goto MAIN
:KILL1 ::POP
UP MESSAGE IF OFFICE APPS ARE OPEN echo Dim WSH, response > %temp%\kill.vbs
echo Set WSH = WScript.CreateObject("WScript.Shell") >> %temp%\kill.vbs echo
response = WSH.Popup ("Setup has detected open Microsoft Office applications.
Please close all Microsoft applications and start deploy again. ", 0, "Open
Application Detection", 0) >> %temp%\kill.vbs wscript.exe %temp%\kill.vbs
echo Dim WSH, response > %temp%\kill2.vbs echo Set WSH =
WScript.CreateObject("WScript.Shell") >> %temp%\kill2.vbs echo response =
WSH.Popup ("If you continue receiving this error, please restart your machine.
", 0, "Open Application Detection", 0) >> %temp%\kill2.vbs wscript.exe
%temp%\kill2.vbs exit /b 1
:MAIN ::BEGIN OFFICE 2007 INSTALLATION
USING CUSTOM MSP FILES IN HE UPDATES FOLDER
::SET MSG FILE echo
Preparing Microsoft Office 2007 deployment...>"%temp%\msg.txt" if exist
%temp%\yes.txt del /q "%temp%\yes.txt"
::SET COUNTER TO 51% set
COUNTER=51
::TEMPORARILY TURNS OFF AUTOMATIC UPDATES net stop wuauserv
::LAUNCH SPLASH SCREEN start "" splash.exe
:WAIT1 ::WAIT FOR
YES/NO SELECTION FROM SPLASH SCREEN if exist %temp%\yes.txt goto NEXT ping
-n 2 127.0.0.1>nul goto WAIT1
:NEXT if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\Office2007EnterpriseSP2\ Enterprise.WW\setup.xml"
goto INSTALL ::IF YES IS SELECTED, LAUNCH SETUP echo Downloading Microsoft
Office 2007 files from server...>"%temp%\msg.txt" start ""
Office_2007_by_EJ.exe
:WAIT2 ::WAITING FOR OFFICE2007 FILES TO BE
DOWNLOADED if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\Office2007EnterpriseSP2\ Office_2007_by_EJ.exe"
goto EXTRACT start /low /b /wait ping -n 10 127.0.0.1>nul goto WAIT2
:EXTRACT echo Extracting Microsoft Office 2007
files(1%%)...>"%temp%\msg.txt" goto EXT1
:EXT1 echo Extracting
Microsoft Office 2007 files(5%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\ Office2007EnterpriseSP2\Excel.en-us"
goto EXT2 start /low /b /wait ping -n 5 127.0.0.1>nul goto EXT1
:EXT2 echo Extracting Microsoft Office 2007 files(11%%)...>"%temp%\msg.txt"
if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\ Office2007EnterpriseSP2\Groove.en-us"
( goto EXT3 ) start /low /b /wait ping -n 5 127.0.0.1>nul goto EXT2
:EXT3 echo Extracting Microsoft Office 2007
files(17%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\Office2007EnterpriseSP2\InfoPath.en-us"
(
goto EXT4 ) start /low /b /wait ping -n 5 127.0.0.1>nul goto
EXT3
:EXT4 echo Extracting Microsoft Office 2007
files(22%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\ Office2007EnterpriseSP2\Office
Admin Templates" (
goto EXT5 ) start /low /b /wait ping -n 5
127.0.0.1>nul goto EXT4
:EXT5 echo Extracting Microsoft Office
2007 files(30%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\ Office2007EnterpriseSP2\Office.en-us"
( goto EXT6 ) start /low /b /wait ping -n 5 127.0.0.1>nul goto EXT5
:EXT6 echo Extracting Microsoft Office 2007
files(34%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\ Office2007EnterpriseSP2\Office64.en-us"
( goto EXT7 ) start /low /b /wait ping -n 5 127.0.0.1>nul goto EXT6
:EXT7 echo Extracting Microsoft Office 2007
files(38%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\Office2007EnterpriseSP2\ OneNote.en-us"
( goto EXT8 ) start /low /b /wait ping -n 5 127.0.0.1>nul goto EXT7
:EXT8 echo Extracting Microsoft Office 2007
files(45%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\ Office2007EnterpriseSP2\Outlook.en-us"
( goto EXT9 ) start /low /b /wait ping -n 5 127.0.0.1>nul goto EXT8
:EXT9 echo Extracting Microsoft Office 2007
files(52%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\Office2007EnterpriseSP2\PowerPoint.en-us"
( goto EXT10 ) start /low /b /wait ping -n 5 127.0.0.1>nul goto EXT9
:EXT10 echo Extracting Microsoft Office 2007
files(56%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\Office2007EnterpriseSP2\Proofing.en-us"
( goto EXT11 ) start /low /b /wait ping -n 5 127.0.0.1>nul goto
EXT10
:EXT11 echo Extracting Microsoft Office 2007
files(64%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\Office2007EnterpriseSP2\Publisher.en-us"
( goto EXT12 ) start /low /b /wait ping -n 5 127.0.0.1>nul goto
EXT11
:EXT12 echo Extracting Microsoft Office 2007
files(67%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\Office2007EnterpriseSP2\Rosebud.en-us"
( goto EXT13 ) start /low /b /wait ping -n 5 127.0.0.1>nul goto
EXT12
:EXT13 echo Extracting Microsoft Office 2007
files(70%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\ Office2007EnterpriseSP2\Updates"
( goto EXT14 ) start /low /b /wait ping -n 5 127.0.0.1>nul goto
EXT13
:EXT14 echo Extracting Microsoft Office 2007
files(75%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\ Office2007EnterpriseSP2\Word.en-us"
( goto EXT15 ) start /low /b /wait ping -n 5 127.0.0.1>nul goto
EXT14
:EXT15 echo Extracting Microsoft Office 2007
files(81%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\ Office2007EnterpriseSP2\Access.en-us"
( goto EXT16 ) start /low /b /wait ping -n 5 127.0.0.1>nul goto
EXT15
:EXT16 echo Extracting Microsoft Office 2007
files(85%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\ Office2007EnterpriseSP2\autorun.inf"
( goto EXT17 ) start /low /b /wait ping -n 5 127.0.0.1>nul goto
EXT16
:EXT17 echo Extracting Microsoft Office 2007
files(89%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\ Office2007EnterpriseSP2\setup.exe"
( goto EXT18 ) start /low /b /wait ping -n 5 127.0.0.1>nul goto
EXT17
:EXT18 echo Extracting Microsoft Office 2007
files(93%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\ Office2007EnterpriseSP2\Admin"
( goto EXT19 ) start /low /b /wait ping -n 5 127.0.0.1>nul goto
EXT18
:EXT19 echo Extracting Microsoft Office 2007
files(95%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\ Office2007EnterpriseSP2\Catalog"
( goto EXT20 ) start /low /b /wait ping -n 5 127.0.0.1>nul goto
EXT19
:EXT20 echo Extracting Microsoft Office 2007
files(96%%)...>"%temp%\msg.txt" if exist
"%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Microsoft\Office2007EnterpriseSP2\ Enterprise.WW\setup.xml"
( goto INSTALL ) start /low /b /wait ping -n 5 127.0.0.1>nul goto
EXT20
:INSTALL echo Extracting Microsoft Office 2007
files(100%%)...>"%temp%\msg.txt" start /low /b /wait ping -n 2 127.0.0.1>nul
start /min "" setup.vbs
::/adminfile updates\Office2007Enterprise4.msp
:INST1 echo Preparing Microsoft Office 2007 setup
files...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\1033" goto INST2 start /low /b /wait ping -n 5 127.0.0.1>nul
goto INST1
:INST2 echo Installing Microsoft Office
2007(1%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\Library" goto INST3 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST2
:INST3 echo Installing Microsoft Office
2007(7%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\Queries" goto INST4 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST3
:INST4 echo Installing Microsoft Office
2007(11%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\SAMPLES" goto INST5 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST4
:INST5 echo Installing Microsoft Office
2007(13%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\ADDINS" goto INST6 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST5
:INST6 echo Installing Microsoft Office
2007(16%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\CONVERT" goto INST7 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST6
:INST7 echo Installing Microsoft Office
2007(18%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\FORMS" goto INST8 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST7
:INST8 echo Installing Microsoft Office
2007(21%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\INFFORMS" goto INST9 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST8
:INST9 echo Installing Microsoft Office
2007(22%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\3082" goto INST10 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST9
:INST10 echo Installing Microsoft Office
2007(23%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\1036" goto INST11 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST10
:INST11 echo Installing Microsoft Office
2007(24%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\Document Parts" goto INST12 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST11
:INST12 echo Installing Microsoft Office
2007(25%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\AccessWeb" goto INST13 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST12
:INST13 echo Installing Microsoft Office
2007(26%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\STARTUP" goto INST14 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST13
:INST14 echo Installing Microsoft Office
2007(27%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\XLSTART" goto INST15 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST14
:INST15 echo Installing Microsoft Office
2007(28%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\ACCWIZ" goto INST16 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST15
:INST16 echo Installing Microsoft Office
2007(29%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\OneNote" goto INST17 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST16
:INST17 echo Installing Microsoft Office
2007(30%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\BITMAPS" goto INST18 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST17
:INST18 echo Installing Microsoft Office
2007(31%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\MEDIA" goto INST19 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST18
:INST19 echo Installing Microsoft Office
2007(32%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\PUBBA" goto INST20 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST19
:INST20 echo Installing Microsoft Office
2007(33%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\PUBWIZ" goto INST21 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST20
:INST21 echo Installing Microsoft Office
2007(34%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\BORDERS" goto INST22 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST21
:INST22 echo Installing Microsoft Office
2007(36%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\PAGESIZE" goto INST23 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST22
:INST23 echo Installing Microsoft Office
2007(41%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\OutlookAutoDiscover" goto INST24 start /low /b /wait ping -n
5 127.0.0.1>nul goto INST23
:INST24 echo Installing Microsoft
Office 2007(47%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\Bibliography" goto INST25 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST24
:INST25 echo Installing Microsoft Office
2007(50%%)...>"%temp%\msg.txt" if exist "%ProgramFiles%\Microsoft
Office\Office12\InfoPathOM" goto INST26 start /low /b /wait ping -n 5
127.0.0.1>nul goto INST25
:INST26 if %COUNTER% LSS 99 SET /A
COUNTER=COUNTER+1 echo Installing Microsoft Office
2007(%COUNTER%%%)...>"%temp%\msg.txt" start /low /b /wait ping -n 60
127.0.0.1>nul start /b /wait /LOW c:\windows\system32\TASKLIST.exe /FI
"IMAGENAME eq setup.exe" | find /i "setup.exe" && (goto INST26) || (goto POLICY)
goto INST26
:POLICY ::POLICY CHECKER SET /A COUNTER=COUNTER+1
echo Installing Microsoft Office 2007(%COUNTER%%%)...>"%temp%\msg.txt" if
%COUNTER% LSS 99 ( ping -n 2 127.0.0.1>nul goto POLICY ) echo
Installing Microsoft Office 2007(100%%)...>"%temp%\msg.txt" start /low /b
/wait ping -n 4 127.0.0.1>nul echo Microsoft Office 2007 installed
successfully! You can use Office 2007 now.> "%temp%\msg.txt" start /low /b
/wait ping -n 7 127.0.0.1>nul goto END
:END ::RESTORE RESOURCES
taskkill.exe /f /im wmplayer.exe taskkill.exe /f /im wmplayer.exe set
COUNTER= if exist %temp%\yes.txt del /q "%temp%\yes.txt" if exist
"%temp%\msg.txt" del /q "%temp%\msg.txt" if exist "%temp%\kill.vbs" del /q
"%temp%\kill.vbs" if exist "%temp%\kill2.txt" del /q "%temp%\kill2.vbs"
taskkill.exe /f /im setup.exe taskkill.exe /f /im mshta.exe taskkill.exe
/f /im mshta.exe ::HANDLE ERRORCODE if not exist
c:\windows\temp\OfficeCode.txt echo 0>c:\windows\temp\OfficeCode.txt for /f
"tokens=*" %%a in (c:\windows\temp\OfficeCode.txt) do set OfficeCode=%%a
::needs reboot if %OfficeCode%==3010 exit /b 0 ::user exited if
%OfficeCode%==1602 exit /b 0 exit /b %OfficeCode% ::exit /b 0
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Δ
Symantec Update Config Command
How to force workstation to update the symantec
configuration
VBScript
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
'::
************************************************************************
':: SCRIPT LANGUAGE: VBScript ':: SCRIPT NAME: UpdateCommand.vbs '::
PURPOSE: To be used to update Symantec Configuration ':: CREATION DATE:
08/30/2010 ':: LAST MODIFIED: ':: DIRECTIONS: Send to client workstation
':: AUTHOR: Eddie Jackson ':: EMAIL: MrNetTek2000@yahoo.com '::
***********************************************************************
on error resume next Set objShell = CreateObject("WScript.Shell")
Err.Number = objShell.Run ("smc €“updateconfig", 0, True) if Err.Number = 3010
then Err.Number = 0 if Err.Number = -1 then Err.Number = 0 if Err.Number =
-2 then Err.Number = 0 if Err.Number = -5 then Err.Number = 0 if
Err.Number = -6 then Err.Number = 0 WScript.Quit(Err.Number)
'smc
-checkinstallation ''Checks whether the smc client service is installed.
'''Returns 0, -3
'smc -checkrunning ''' Checks whether the smc
client service is running. ''''Returns 0, -4
'smc -dismissgui
'''Closes either the Symantec Endpoint Protection or Symantec Network Access Control client user interface, including the notification area icon. '''The
client still runs and protects the client computer. '''Returns 0
'smc -exportlog '''Exports the entire contents of a log to a .txt file.
'''To export a log, you use the following syntax: '''smc -exportlog log_type
0 -1 output_file '''where: ''' '''log_type is: ''' '''0 = System
Log ''' '''1 = Security Log ''' '''2 = Traffic Log ''' '''3 =
Packet Log ''' '''4 = Control Log ''' '''For example, you might type
the following syntax: ''' '''smc -exportlog 2 0 -1 c:\temp\TrafficLog
''' '''Where: ''' '''0 is the beginning of the file ''' '''-1 is
the end of the file ''' '''You can export only the Control log, Packet
log, Security log, System log, and Traffic log. ''' '''output_file is the
path name and file name that you assign to the exported file. '''
'''Returns 0, -2, -5
'smc -runhi '''If Symantec Network Access
Control is installed, runs a Host Integrity check. '''Returns 0
'smc -showgui '''Displays either the Symantec Endpoint Protection or the
Symantec Network Access Control client user interface. '''Returns 0
'smc -updateconfig '''Checks whether the configuration file on the
management server is more recent than the configuration file on the client. The
configuration file includes all the settings on the management server, such as
policies, groups, log settings, security settings, and user interface settings.
'''If the client's configuration file is out of date, updateconfig downloads the
most recent configuration file and replaces the existing configuration file,
which is serdef.dat. '''Returns 0
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Δ
Tuesday, August 24th 2010
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Δ
Bigger and Better Splash Screens
How to code nicer splash screens with dynamic status
update
(useful if you need to have a splash screen displayed from a software package
installation)
HTA-VBScript
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
<script>
<script language="vbscript"> Window.ReSizeTo 0,0
Window.moveTo -500, 0 </script>
<!--
==================================================== Name: Splash Screen
Author: Eddie Jackson Contact: MrNetTek2000@yahoo.com Created on:
08/26/2010 Modified: Modified by: Description: A splash screen
template ==================================================== -->
<HTML> <HEAD> <TITLE>SPLASHSCREEN</TITLE>
<HTA:APPLICATION
APPLICATIONNAME = "SplashScreen" BORDER = "None" CAPTION = "No"
CONTEXTMENU = "No" INNERBORDER = "No" MAXIMIZEBUTTON = "No"
MINIMIZEBUTTON = "No" NAVIGABLE = "Yes" SCROLL = "No" SELECTION = "No"
SHOWINTASKBAR = "No" SINGLEINSTANCE = "Yes" SYSMENU = "No" WINDOWSTATE
= "Normal" />
</HEAD>
<SCRIPT LANGUAGE="VBScript"> On error
resume next
'VARIABLES Dim fso, tempFolder, timerID, strLine,
timerID2 Set objShell = CreateObject("WScript.Shell") Const WindowsFolder
= 0 Const SystemFolder = 1 Const TemporaryFolder = 2
Set
objShell = CreateObject("WScript.Shell") Set filesys =
CreateObject("Scripting.FileSystemObject") Set fso =
CreateObject("Scripting.FileSystemObject") Set oProcEnv =
objShell.Environment("PROCESS")
'SETS THE MUSIC strMediaPlayer =
"C:\Program Files\Windows Media Player\wmplayer.exe" strMusic =
"C:\Progra~1\LANDesk\LDClient\sdmcache\APPS\Microsoft\ Office2007EnterpriseSP2\music.mp3"
strPlaylist =
"C:\Progra~1\LANDesk\LDClient\sdmcache\APPS\Microsoft\ Office2007EnterpriseSP2 \playme.wpl"
'GETS PROGRAMFILES DIRECTORY sProgramFiles = oProcEnv("ProgramFiles")
tempFolder = fso.GetSpecialFolder(TemporaryFolder)
If sProgramFiles = ""
Then sProgramFiles =
oShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion \ProgramFilesDir")
End If
objShell.Run "commandfile.cmd",0,False
Sub
Window_OnLoad on error resume next
'DISABLED RIGHT NOW 'SET
UP INITIAL MSG 'forWriting = 2 'Overwrite = True
'Set objMsg =
fso.OpenTextFile(tempFolder & "\msg.txt", 2, True) 'objMsg.WriteLine
"Processing..." 'objMsg.Close
'FORMATS THE INNERHTML
DataArea.InnerHTML = " " DataArea.InnerHTML = " " DataArea.InnerHTML = " "
DataArea2.InnerHTML = "<br><br><br><br><br>" DataArea2.InnerHTML =
"<br><br><br><br><br>" DataArea2.InnerHTML = "<br><br><br><br><br>"
DataArea2.InnerHTML = "<br><br><br><br><br>"
'SETS SCREEN SIZE - ADJUSTS
TO END-USERS DISPLAY window.moveTo 0, 0 window.moveTo 0, 0
window.resizeTo (screen.width), (screen.height) window.resizeTo
(screen.width), (screen.height)
'DISABLED RIGHT NOW '3 LEVELS OF
VERIFICATION TO PLAY THE MUSIC FILE, NEEDS MEDIA PLAYER, MUSIC, AND PLAYLIST
'If filesys.FileExists(strMediaPlayer) THEN ' If filesys.FileExists(strMusic)
THEN ' on error resume next ' If filesys.FileExists(strPlaylist) THEN
' on error resume next ' objShell.Run strPlaylist,0, False ' end if '
end if 'end if
'SETS 2 SEPARATE TIMING IDs timerID =
window.setInterval("RefreshTime", 1100) 'milliseconds timerID2 =
window.setInterval("RefreshTime2", 1100) 'milliseconds
RefreshTime
RefreshTime2 DataArea.InnerHTML = " " DataArea.InnerHTML = " "
DataArea.InnerHTML = " " DataArea2.InnerHTML = "<br><br><br><br><br>"
DataArea2.InnerHTML = "<br><br><br><br><br>" DataArea2.InnerHTML =
"<br><br><br><br><br>" DataArea2.InnerHTML = "<br><br><br><br><br>"
End Sub
Sub RefreshTime on error resume next CurrentTime.InnerHTML
= Now End Sub
Sub RefreshTime2 on error resume next
'This
reads in the progress message ForReading = 1 Set objFSO =
CreateObject("Scripting.FileSystemObject") Set objFile =
objFSO.OpenTextFile(tempFolder & "\msg.txt", ForReading) strLine =
objFile.ReadLine
'Set objFile = objFSO.OpenTextFile(tempFolder &
"\msg2.txt", ForReading) 'strLine2 = objFile.ReadLine
DataArea2.InnerHTML = ""
if strLine="Downloading files(0%)" then
DataArea.InnerHTML = "<IMG src="&chr(34) & "progress_all.gif"&chr(34)&"
application="&chr(34)&"yes"&chr(34)&" width="&chr(34)&"10%"&chr(34)&"
height="&chr(34)&"2%"&chr(34)&" marginwidth="&chr(34)&"0"&chr(34)&" marginheight="&chr(34)&"0"&chr(34)&"
frameborder="&chr(34)&"0"&chr(34) &"><h2><i>" & strLine & "</i></h2>" end if
if strLine="Downloading files(25%)" then DataArea.InnerHTML = "<IMG
src="&chr(34) & "progress_all.gif"&chr(34)&"
application="&chr(34)&"yes"&chr(34)&" width="&chr(34)&"10%"&chr(34)&"
height="&chr(34)&"2%"&chr(34)&" marginwidth="&chr(34)&"0"&chr(34)&"
marginheight="&chr(34)&"0"&chr(34)&"
frameborder="&chr(34)&"0"&chr(34) &"><h2><i>" & strLine & "</i></h2>" end if
if strLine="Downloading files(50%)" then DataArea.InnerHTML = "<IMG
src="&chr(34) & "progress_all.gif"&chr(34)&"
application="&chr(34)&"yes"&chr(34)&" width="&chr(34)&"10%"&chr(34)&"
height="&chr(34)&"2%"&chr(34)&" marginwidth="&chr(34)&"0"&chr(34)&"
marginheight="&chr(34)&"0"&chr(34)&"
frameborder="&chr(34)&"0"&chr(34) &"><h2><i>" & strLine & "</i></h2>" end if
if strLine="Downloading files(75%)" then DataArea.InnerHTML = "<IMG
src="&chr(34) & "progress_all.gif"&chr(34)&"
application="&chr(34)&"yes"&chr(34)&" width="&chr(34)&"10%"&chr(34)&" height="&chr(34)&"2%"&chr(34)&" marginwidth="&chr(34)&"0"&chr(34)&" marginheight="&chr(34)&"0"&chr(34)&"
frameborder="&chr(34)&"0"&chr(34) &"><h2><i>" & strLine & "</i></h2>" end if
if strLine="Downloading files(100%)" then DataArea.InnerHTML = "<IMG
src="&chr(34) & "progress_all.gif"&chr(34)&"
application="&chr(34)&"yes"&chr(34)&" width="&chr(34)&"10%"&chr(34)&"
height="&chr(34)&"2%"&chr(34)&" marginwidth="&chr(34)&"0"&chr(34)&"
marginheight="&chr(34)&"0"&chr(34)&"
frameborder="&chr(34)&"0"&chr(34) &"><h2><i>" & strLine & "</i></h2>" end if
DataArea2.InnerHTML = "" if strLine="Deploying package(0%)" then
DataArea.InnerHTML = "<IMG src="&chr(34) & "progress_all.gif"&chr(34)&"
application="&chr(34)&"yes"&chr(34)&" width="&chr(34)&"10%"&chr(34)&"
height="&chr(34)&"2%"&chr(34)&" marginwidth="&chr(34)&"0"&chr(34)&"
marginheight="&chr(34)&"0"&chr(34)&"
frameborder="&chr(34)&"0"&chr(34) &"><h2><i>" & strLine & "</i></h2>" end if
DataArea2.InnerHTML = "" if strLine="Deploying package(25%)" then
DataArea.InnerHTML = "<IMG src="&chr(34) & "progress_all.gif"&chr(34)&"
application="&chr(34)&"yes"&chr(34)&" width="&chr(34)&"10%"&chr(34)&"
height="&chr(34)&"2%"&chr(34)&" marginwidth="&chr(34)&"0"&chr(34)&"
marginheight="&chr(34)&"0"&chr(34)&"
frameborder="&chr(34)&"0"&chr(34) &"><h2><i>" & strLine & "</i></h2>" end if
DataArea2.InnerHTML = "" if strLine="Deploying package(50%)" then
DataArea.InnerHTML = "<IMG src="&chr(34) & "progress_all.gif"&chr(34)&"
application="&chr(34)&"yes"&chr(34)&" width="&chr(34)&"10%"&chr(34)&"
height="&chr(34)&"2%"&chr(34)&" marginwidth="&chr(34)&"0"&chr(34)&"
marginheight="&chr(34)&"0"&chr(34)&"
frameborder="&chr(34)&"0"&chr(34) &"><h2><i>" & strLine & "</i></h2>" end if
DataArea2.InnerHTML = "" if strLine="Deploying package(75%)" then
DataArea.InnerHTML = "<IMG src="&chr(34) & "progress_all.gif"&chr(34)&"
application="&chr(34)&"yes"&chr(34)&" width="&chr(34)&"10%"&chr(34)&"
height="&chr(34)&"2%"&chr(34)&" marginwidth="&chr(34)&"0"&chr(34)&"
marginheight="&chr(34)&"0"&chr(34)&"
frameborder="&chr(34)&"0"&chr(34) &"><h2><i>" & strLine & "</i></h2>" end if
DataArea2.InnerHTML = "" if strLine="Deploying package(100%)" then
DataArea.InnerHTML = "<IMG src="&chr(34) & "progress_all.gif"&chr(34)&"
application="&chr(34)&"yes"&chr(34)&" width="&chr(34)&"10%"&chr(34)&"
height="&chr(34)&"2%"&chr(34)&" marginwidth="&chr(34)&"0"&chr(34)&"
marginheight="&chr(34)&"0"&chr(34)&"
frameborder="&chr(34)&"0"&chr(34) &"><h2><i>" & strLine & "</i></h2>" end if
if strLine="Package deployed successfully!" then DataArea.InnerHTML =
"<h5><br></h5><h2>"&strLine&"</h2>" end if objFile.Close
End Sub
Sub OnClickButtonStop() window.clearInterval(timerID) End Sub
</SCRIPT>
<body> <font color = gray><span
id="CurrentTime"></span></font> </body>
<SCRIPT language="vbscript">
On Error Resume Next
On Error Resume Next Document.Write
"<HTML>" &_ "<BODY>" &_ "<CENTER>" &_ "<CENTER><img width=96% height="
& (screen.height)-140 & " src='" & "splashscreen_1440x900.jpg'
onError='contentALT'/><span id=DataArea> </span><span
id=DataArea2></span></CENTER>" &_ "For assistance, Please call the Service
Desk at [xxxxxx]<br>" &_ "</CENTER>" &_ "</BODY>" &_ "</HTML>"
Sub contentALT On error resume next Dim Line1, Line2, Line3,
Line4 Line1 = "<br>Processing..." Line2 = "<br><br><br><br><br>P L E A S
E W A I T " Line3 = "<br><br><br><br><br>For assistance, Please
call the Service Desk at [xxxxx]" Line4 = "" Document.Write "<HTML>" &
vbCrLf &_ "<style type='text/css'>" & vbCrLf &_ "#01 { position:relative
}" & vbCrLf &_ "#02 { position:relative }" & vbCrLf &_ "#03 {
position:relative }" & vbCrLf &_ "#04 { position:absolute; width: 1440;
top:5%; font-size: 2.5em; }" & vbCrLf &_ "</style>" & vbCrLf &_ "<BODY>" &
vbCrLf &_ "<div id='01'><div id='02'><div id='03'><div id='04'>" & vbCrLf &_
"<p><center>" & Line1 & "</p>" & vbCrLf &_ "<p>" & Line2 & "</p>" & vbCrLf &_
"<p>" & Line3 & "</p>" & vbCrLf &_ "<p>" & Line4 & "</p>" & vbCrLf &_
"</CENTER></div></div>" & vbCrLf &_ "</BODY>" & vbCrLf &_ "</HTML>"
End Sub
Sub EndSplash objFile.Close end sub
</SCRIPT>
</HTML>
</script>
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Shell:
the command file that talks to the splash screen.
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
@echo on
::DOWNLOADING FILES FROM LANDESK SERVER ::DOWNLOAD TIMING
(in seconds) SET DLTIMING=4
::DOWNLOAD FILE NAMES ::ADD THE
FILE/FOLDER PATHS TO BE USED AS MARKERS SET DLFILE0=c:\windows\notepad.exe
SET DLFILE25=c:\windows\notepad.exe SET DLFILE50=c:\windows\notepad.exe
SET DLFILE75=c:\windows\notepad.exe SET
DLFILE100=%ProgramFiles%\LANDesk\LDClient\sdmcache\APPS\Vault\ Symantec
Enterprise Vault Outlook Add-in-en.msi
::DEPLOYING FILES ON LOCAL
MACHINE ::DEPLOY PACKAGE TIMING (in seconds) SET DPTIMING=4
::DEPLOY FILE NAMES ::ADD THE FILE/FOLDER PATHS TO BE USED AS MARKERS SET
DPFILE0=%ProgramFiles%\Enterprise Vault\EVClient\DesktopClientCache.dll SET
DPFILE25=%ProgramFiles%\Enterprise Vault\EVClient\EVMSP32.dll SET
DPFILE50=%ProgramFiles%\Enterprise Vault\EVClient\EVStgAPI.dll SET
DPFILE75=%ProgramFiles%\Enterprise Vault\EVClient\Valkyrie.dll SET
DPFILE100=c:\windows\notepad.exe
::SET EXTRA SETTINGS - USED TO
APPLY A FEW CUSTOMIZED SETTINGS TO PORTAL DEPLOYMENT
::REGKEY TO BE
INSTALLED POST SETUP - APPLY A REG KEY AFTER SETUP (EXAMPLE: any local machine
hive key) ::SET REGKEY=PathToRegKey.reg
::DEL FILE POST SETUP - DEL A
FILE AFTER SETUP (EXAMPLES: shortcuts) ::SET DELFILE=PathToFileToDelete
::TASKKILL A PROCESS POST SETUP - USED TO KILL A SINGLE TASK (EXAMPLES:
shortcuts) ::SET TSKKILL=ProcessNameToKill
::CONTROL HOW THE
SOFTWARE DEPLOYMENT PORTAL WILL BE HANDLED ::SET CONTROLS TRUE or FALSE
::TASKKILL LANDESK SOFTWARE DEPLOYMENT PORTAL WINDOW - KILLS PROCESS RIGHT
AWAY SET CONTROL1=FALSE
::TASKKILL TASK LANDESK SUCCESSFUL POPUP
WINDOW - KILLS PROCESS WHEN IT POPS UP SET CONTROL2=FALSE
IF %CONTROL1%==TRUE taskkill /f /im policy.client.portal.exe
:A1
echo Downloading files(0%%)> "%temp%\msg.txt" ping -n %DLTIMING%
127.0.0.1>nul IF EXIST "%DLFILE0%" GOTO A2 goto A1
:A2 echo
Downloading files(25%%)> "%temp%\msg.txt" c:\windows\system32\TASKLIST.exe
/FI "IMAGENAME eq htmldialog.exe" | find /i "htmldialog.exe" && goto DONE
ping -n %DLTIMING% 127.0.0.1>nul IF EXIST "%DLFILE25%" GOTO A3 goto A2
:A3 echo Downloading files(50%%)> "%temp%\msg.txt"
c:\windows\system32\TASKLIST.exe /FI "IMAGENAME eq htmldialog.exe" |
find /i
"htmldialog.exe" && goto DONE ping -n %DLTIMING% 127.0.0.1>nul IF EXIST
"%DLFILE50%" GOTO A4 goto A3
:A4 echo Downloading files(75%%)>
"%temp%\msg.txt" c:\windows\system32\TASKLIST.exe /FI "IMAGENAME eq
htmldialog.exe" | find /i "htmldialog.exe" && goto DONE ping -n %DLTIMING%
127.0.0.1>nul IF EXIST "%DLFILE75%" GOTO A5 goto A4
:A5 echo
Downloading files(100%%)> "%temp%\msg.txt" c:\windows\system32\TASKLIST.exe
/FI "IMAGENAME eq htmldialog.exe" | find /i "htmldialog.exe" && goto DONE
ping -n %DLTIMING% 127.0.0.1>nul IF EXIST "%DLFILE100%" GOTO B1 goto A5
:B1 echo Deploying package(0%%)> "%temp%\msg.txt"
c:\windows\system32\TASKLIST.exe /FI "IMAGENAME eq htmldialog.exe" |
find /i
"htmldialog.exe" && goto DONE ping -n %DPTIMING% 127.0.0.1>nul IF EXIST
"%DPFILE0%" GOTO B2 goto B1
:B2 echo Deploying package(25%%)>
"%temp%\msg.txt" c:\windows\system32\TASKLIST.exe /FI "IMAGENAME eq
htmldialog.exe" | find /i "htmldialog.exe" && goto DONE ping -n %DPTIMING%
127.0.0.1>nul IF EXIST "%DPFILE25%" GOTO B3 goto B2
:B3 echo
Deploying package(50%%)> "%temp%\msg.txt" c:\windows\system32\TASKLIST.exe
/FI "IMAGENAME eq htmldialog.exe" | find /i "htmldialog.exe" && goto DONE
ping -n %DPTIMING% 127.0.0.1>nul IF EXIST "%DPFILE50%" GOTO B4 goto B3
:B4 echo Deploying package(75%%)> "%temp%\msg.txt"
c:\windows\system32\TASKLIST.exe /FI "IMAGENAME eq htmldialog.exe" | find /i
"htmldialog.exe" && goto DONE ping -n %DPTIMING% 127.0.0.1>nul IF EXIST
"%DPFILE75%" GOTO B5 goto B4
:B5 echo Deploying package(100%%)>
"%temp%\msg.txt" c:\windows\system32\TASKLIST.exe /FI "IMAGENAME eq
htmldialog.exe" | find /i "htmldialog.exe" && goto DONE ping -n 1
127.0.0.1>nul IF EXIST "%DPFILE100%" GOTO DONE goto B5
:DONE
echo Deploying package(100%%)> "%temp%\msg.txt" ping -n 1 127.0.0.1>nul IF
%CONTROL2%==TRUE ( c:\windows\system32\TASKLIST.exe /FI "IMAGENAME eq
htmldialog.exe" | find /i "htmldialog.exe" && (taskkill.exe /f /im
htmldialog.exe & goto END) || (goto DONE) c:\windows\system32\TASKLIST.exe
/FI "IMAGENAME eq htmldialog.exe" | find /i "htmldialog.exe" && (taskkill.exe /f
/im htmldialog.exe & goto END) || (goto DONE) goto END ) goto END
:END echo Package deployed successfully!> "%temp%\msg.txt" echo
Package deployed successfully!> "%temp%\msg.txt" regedit /s "%REGKEY%" if
exist "%DELFILE%" del /q "%DELFILE%" ping -n 7 127.0.0.1>nul
c:\windows\system32\taskkill.exe /f /im %TSKKILL%
c:\windows\system32\taskkill.exe /f /im mshta.exe
c:\windows\system32\taskkill.exe /f /im mshta.exe if exist "%temp%\msg.txt"
del /q "%temp%\msg.txt" exit
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Δ
Saturday, August 21th 2010
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Δ
PING And Run Command + Timestamped Logs
How to ping a list of computers and run a command for the
online machines
(useful if you need to execute a command for an online list of computers)
Shell
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
@rem
*************************************************************************
@rem Script Language: Shell @rem Script Name: PING_RUN.cmd @rem Purpose:
PING a list of workstations and return PST Report @rem Creation Date:
06/07/2010 @rem Last Modified: @rem Directions: double-click the
PING_RUN.cmd @rem Author: Eddie Jackson @rem
*************************************************************************
@ECHO OFF title=PST Report & color 8e
:MAIN cls ::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:\PING_ONLINE_%yy%-%mm%-%dd%_%HHMM%.txt) (Set
OutputFile2=C:\"PING_OFFLINE_%yy%-%mm%-%dd%_%HHMM%.txt") (Set
WS=C:\computers.txt)
@ECHO OFF for /f "tokens=* delims= " %%a in
(c:\computers.txt) do ( ping -a -n 1 -w 100 %%a | find "Reply" > nul if
errorlevel 1 ( rem offline area echo %%a, OFFLINE >> "%OutputFile2%" &
echo %%a OFFLINE & echo %%a>> "C:\newlist.txt" ) else ( rem online
area echo %%a>> "%OutputFile%" & echo Getting PSTs on %%a... dir /B /S
\\%%a\c$\"documents and settings"\*.pst >> c:\getpstnow.txt ) ) EXIT
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Δ
Friday, August 20th 2010
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Δ
Return Site Code Back To LANDesk + Return Gateway
How to return a site code back to LANDesk to be used for
reporting
(usefule if you need to identify each site uniquely)
Shell
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
:::::PASSIVE SCRIPT @echo on
rem SET VARIABLES TO BE USED IN FOR/IN
setLocal EnableDelayedExpansion set gwname=%%j set var=%%a%%b
rem
THIS WILL DELETE THE CURRENT REG KEY reg delete
HKEY_LOCAL_MACHINE\System\MySiteLocation /f
rem THIS WILL SEND GATEWAY
INFO TO TEXT FILE ipconfig | find "Default Gateway">%temp%\ip.txt
rem
THIS WILL RETURN JUST THE GATEWAY ADDRESS for /f "tokens=1-2 delims=:" %%i in
(%temp%\ip.txt) do ( set gwname=%%j rem THIS WILL REMOVE LEADING SPACE
FROM GATEWAY ADDRESS for /f "tokens=1-2 delims= " %%a in ("%gwname%") do (
set var=%%a%%b ) rem site1 if !var!==192.168.1.1 set var=Site1 & reg
add HKEY_LOCAL_MACHINE\System\ MySiteLocation /v gateway /t REG_SZ /d !var!
/f & "C:\Program Files\LANDesk\ LDClient\sdclient.exe" /msg="!var!" & exit /b
%errorlevel% if !var!==192.168.1.2 set var=Site1 & reg add
HKEY_LOCAL_MACHINE\ System\MySiteLocation /v gateway /t REG_SZ /d !var! /f &
"C:\Program Files\ LANDesk\LDClient\sdclient.exe" /msg="!var!" & exit /b
%errorlevel%
rem site2 if !var!==x.x.x.x set var=Site2 & reg add
HKEY_LOCAL_MACHINE\System\ MySiteLocation /v gateway /t REG_SZ /d !var! /f &
exit /b %errorlevel%
rem site3 if !var!==x.x.x.x set var=Site3 & reg
add HKEY_LOCAL_MACHINE\System\ MySiteLocation /v gateway /t REG_SZ /d !var!
/f & exit /b %errorlevel%
rem site4 if !var!==x.x.x.x set var=Site4 &
reg add HKEY_LOCAL_MACHINE\System\ MySiteLocation /v gateway /t REG_SZ /d
!var! /f & exit /b %errorlevel%
rem site5 if !var!==x.x.x.x set
var=Site5 & reg add HKEY_LOCAL_MACHINE\System\ MySiteLocation /v gateway /t
REG_SZ /d !var! /f & exit /b %errorlevel%
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Δ
Wednesday, August 18th 2010
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Δ
Return OS In Batch Shell + Multi-OS Support
How to return the operating system in shell
Script
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
@echo on
:::::::::::BEGIN OS CHECK:::::::::::: ver | find "2003" > nul
if %ERRORLEVEL% == 0 goto ver_2003
ver | find "XP" > nul if
%ERRORLEVEL% == 0 goto ver_xp
ver | find "2000" > nul if %ERRORLEVEL%
== 0 goto ver_2000
ver | find "NT" > nul if %ERRORLEVEL% == 0 goto
ver_nt
if not exist %SystemRoot%\system32\systeminfo.exe goto
warnthenexit
systeminfo | find "OS Name" > %TEMP%\osname.txt FOR /F
"usebackq delims=: tokens=2" %%i IN (%TEMP%\osname.txt) DO set vers=%%i
echo %vers% | find "Windows 7" > nul if %ERRORLEVEL% == 0 goto ver_7
echo %vers% | find "Windows Server 2008" > nul if %ERRORLEVEL% == 0 goto
ver_2008
echo %vers% | find "Windows Vista" > nul if %ERRORLEVEL% == 0
goto ver_vista
goto warnthenexit
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::RUN OS ROUTINE:::::::::::: :ver_7 :: Windows 7
msiexec.exe /qn /i "AcroPro9.msi" /qb /norestart TRANSFORMS=AcroPro9.mst REBOOT=ReallySuppress msiexec.exe /qn /p
"AcroProStdUpd910_T1T2_incr.msp;AcrobatUpd911_all_incr.msp; AcrobatUpd912_all_incr.msp;
AcrobatUpd913_all_incr.msp;AcrobatUpd920_all_incr.msp; AcrobatUpd930_all_incr.msp;
AcrobatUpd932_all_incr.msp;AcrobatUpd933_all_incr.msp" REINSTALLMODE=omus
REINSTALL=ALL ALLUSERS=1 EULA_ACCEPT=YES SUPPRESS_APP_LAUNCH=YES /qb /norestart
goto exit
:ver_2008 :: Windows Server 2008 goto exit
:ver_vista :: Windows Vista msiexec.exe /qn /i "AcroPro9.msi" /qb
/norestart TRANSFORMS= AcroPro9.mst REBOOT=ReallySuppress msiexec.exe /qn /p
"AcroProStdUpd910_T1T2_incr.msp;AcrobatUpd911_all_incr.msp; AcrobatUpd912_all_incr.msp;
AcrobatUpd913_all_incr.msp;AcrobatUpd920_all_incr.msp; AcrobatUpd930_all_incr.msp;
AcrobatUpd932_all_incr.msp;AcrobatUpd933_all_incr.msp" REINSTALLMODE=omus
REINSTALL=ALL ALLUSERS=1 EULA_ACCEPT=YES SUPPRESS_APP_LAUNCH=YES /qb /norestart
goto exit
:ver_2003 :: Windows Server 2003 goto exit
:ver_xp
echo Windows XP msiexec.exe /qn /i "AcroPro9.msi" /qb /norestart
TRANSFORMS= AcroPro9.mst REBOOT=ReallySuppress msiexec.exe /qn /p
"AcroProStdUpd910_T1T2_incr.msp;AcrobatUpd911_all_incr.msp; AcrobatUpd912_all_incr.msp;
AcrobatUpd913_all_incr.msp;AcrobatUpd920_all_incr.msp; AcrobatUpd930_all_incr.msp;
AcrobatUpd932_all_incr.msp;AcrobatUpd933_all_incr.msp" REINSTALLMODE=omus
REINSTALL=ALL ALLUSERS=1 EULA_ACCEPT=YES SUPPRESS_APP_LAUNCH=YES /qb /norestart
goto exit
:ver_2000 :: Windows 2000 goto exit
:ver_nt ::
Windows NT goto exit
:warnthenexit :: Trying last logic if exist
c:\Users\Public goto ver_7 if exist "c:\Documents and Settings\All Users\"
goto ver_xp goto exit
:exit ::ADD OTHER EXIT COMMANDS HERE goto
policy
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::CHECKS ANY POLICIES I HAVE:::::::::::: :policy ::POLICY
CHECKER if "%errorlevel%"=="3010" goto needreboot goto end
:needreboot ::THIS RETURNS EXIT CODE 0 - SUCCESS CODE - IF NEED-TO-REBOOT IS
RETURNED exit /b 0
:end exit /b %errorlevel%
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Δ
Wednesday, August 11th 2010
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Δ
Return Folder Size In Batch Shell
How to return the size of a folder in shell
Script
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
@echo off setLocal EnableDelayedExpansion set /a value=0 set /a
sum=0 FOR /R c:\audio %%I IN (*) DO ( set /a value=%%~zI/1024 set /a
sum=!sum!+!value! ) @echo Size is: !sum! k pause
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Δ
Return File Size In Batch Shell
How to return the size of a file in shell
Script
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
@echo off setlocal set file=C:\audio\cw9\AMPSIMLITE.HLP set
maxbytesize=1000
FOR /F "usebackq" %%A IN ('%file%') DO set size=%%~zA
Echo %size% bytes
if %size% LSS %maxbytesize% ( echo.File is
^< %maxbytesize% bytes ) ELSE ( echo.File is ^>= %maxbytesize%
bytes ) pause
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Δ
Scan For Local PSTs And Return Report
How to scan workstations and return PST information
(Useful for LAN administration)
VBScript
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
'=========================================================== 'L A N G U A
G E 'VBScript ' 'S C R I P T N A M E 'ScanPST.VBS ' 'P U R P
O S E 'To scan for PSTs and return report ' 'U S A G E ' 'A U T
H O R 'Eddie S. Jackson ' 'D A T E C R E A T E D '06/07/2010 '
'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 ' ' '===========================================================
' S T A T I C V A R I A B L E S
'===========================================================
'SCAN
FILES IN SUB-FOLDERS? '[options]- true or false includeSubfolders = true
'FILES WITH EXTENSIONS PROVIDED IN THE LIST BELOW WILL BE DSCANNED
'[options]- any file type including multiple files separated by a comma, no
spaces strExtensionsToScan = "pst"
'MAX FILE AGE IN DAYS. FILES OLDER
THAN THIS WILL NOT BE RETURNED. '[options]- any amount of days minAge = 14
'instantiates object Const ForAppending = 8 Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTextFile =
objFSO.OpenTextFile("c:\computers.txt", ForReading) Set objLogFile =
objFSO.OpenTextFile("c:\log.txt", ForAppending, True)
'=========================================================
' D
Y N A M I C V A R I A B L E S
'========================================================= Do Until
objTextFile.AtEndOfStream '#On error resume next
'COMPUTER NAME TO
SCAN FILES strComputer = objTextFile.Readline
'FOLDER TO SCAN FILES
'[options]- any folder strFolder = "\\" & strComputer & "\c$\Documents and
Settings\"
'==========================================================
' M
A I N '==========================================================
'calls sub ScanFiles strFolder,strExtensionsToScan, minAge, includeSubFolders
Loop '==========================================================
' S U B R O U T I N E
'========================================================== 'sub begins
here sub ScanFiles(byval strDirectory,byval strExtensionsToScan,byval
minAge,includeSubFolders) on error resume next DIM objFolder,
objSubFolder, objFile DIM strExt
Set objFolder =
objFSO.GetFolder(strDirectory)
for each objFile in objFolder.Files on
error resume next for each strExt in SPLIT(UCASE(strExtensionsToScan),",")
if RIGHT(UCASE(objFile.Path),LEN(strExt)+1) = "." & strExt then on error
resume next IF objFile.DateLastModified > (Now - minAge) THEN strLog =
objFile.Path & "\" & objFile.Size & "\" & objFile.DateLastModified & "\"
&
objFile.DateLastAccessed WScript.Echo strLog objLogFile.WriteLine(strLog)
exit for 'objLogFile.Close END IF end if next next if
includeSubFolders = true then ' Recursive scan on error resume next for
each objSubFolder in objFolder.SubFolders on error resume next ScanFiles
objSubFolder.Path,strExtensionsToScan,minAge, includeSubFolders
next
end if
end sub
'========================================================
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Δ
Tuesday, August 10th 2010
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Δ
Adobe Professional 9.0.0 Update Command
How to install all adobe updates from 9.0.0 to 9.3.3 with
a single command
Command
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
c:\windows\system32\msiexec.exe /p
"F:\AU\AcroProStdUpd910_T1T2_incr.msp;f:\au\AcrobatUpd911_all_incr.msp; f:\au\AcrobatUpd912_all_incr.msp;f:\au\AcrobatUpd913_all_incr.msp; f:\au\AcrobatUpd920_all_incr.msp;f:\au\AcrobatUpd930_all_incr.msp; f:\au\AcrobatUpd932_all_incr.msp;f:\au\AcrobatUpd933_all_incr.msp"
REINSTALLMODE=omus REINSTALL=ALL ALLUSERS=1
EULA_ACCEPT=YES SUPPRESS_APP_LAUNCH=YES /qn /norestart
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Δ
Return Model Of Machine
How to return the model of a machine in shell and
vbscript *
(Useful for writing hybrid scripts that will handle logic for different models
of machines)
Shell
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
for /f "delims==" %%a in ('wmic csproduct get name ^| find /c /i "6930"')
do set
/a machine=%%a if %machine% geq 1 ( ECHO Running on a 6930 machine
GOTO DOTHIS1 ) else ( GOTO DOTHIS2 )
:DOTHIS1 @REM
YourCodeGoesHere Goto end
:DOTHIS2 @REM YourCodeGoesHere
Goto end
:END
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
VBScript
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Δ
Monday, August 9th 2010
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Δ
PING In VBScript
How to PING And Return True Or False
(Useful for detecting if a machine is on before you launch or
process a routine)
VBScript
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Dim strComputer
strComputer = "YourComputerName"
if
TestPing(strComputer) = True then msgbox "online" if TestPing(strComputer) =
False then msgbox "offline"
Function TestPing(strComputer) Dim
cPingResults, oPingResult Set cPingResults =
GetObject("winmgmts://./root/cimv2").ExecQuery("SELECT * FROM Win32_PingStatus
WHERE Address = '" & strComputer & "'") For Each oPingResult In cPingResults
If oPingResult.StatusCode = 0 Then TestPing = True 'WScript.Echo
"Machine is online" Else TestPing = False 'WScript.Echo "Machine is
offline" End If Next End Function
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Δ
Turning Firewall Off Command
How to disable the firewall
Windows 7 Command
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
netsh advfirewall set allprofiles state off
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Windows XP Command
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
netsh firewall set opmode disable
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Δ
Thursday, August 5th 2010
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Δ
Microsoft Office 2007 Enterprise
Deployment
How to install and uninstall Office 2007 in your
enterprise
Install silently
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
"setup.exe" /adminfile "office.msp" - create the MSP using office
customization tool - setup.exe /admin
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Un-install silently
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
msiexec.exe /qn {90120000-0011-0000-0000-0000000FF1CE} /norestart
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
LANDesk Deployment
01 - Add setup files to your LANDesk Server Software folder
02 - Select [New] from the LANDesk Web Console 03 - Select [Type] {Batch File, SWD
Package, Executable, Linux, MAC, MSI, VA, WSH} 04 - [Name] your package 05
- Select [Primary File], which is just your MSI package 06 - [Save] 07 - Select [Schedule] from the
LANDesk Web Console 08 - [Name] your schedule 09 - Select [Distribution
package] 10 - Select [Delivery method] 11 - Select [Target devices] 12
- Select [Schedule task] start time 13 - [Save]
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Δ
Tuesday, August 3rd 2010
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
Δ
Return OS Version Into Variable + Multi-OS Support
How to return operating system with VBScript
(Useful for writing hybrid scripts that will handle logic for XP and Windows 7)
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
On Error Resume Next
Dim strComputer, OSDetect,
objWMIService, colInstances strComputer = "."
Const
wbemFlagReturnImmediately = &h10 Const wbemFlagForwardOnly = &h20
Set
objWMIService = GetObject( "winmgmts://" & strComputer & "/root/CIMV2" ) Set
colInstances = objWMIService.ExecQuery( "SELECT * FROM Win32_OperatingSystem",
"WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly )
For Each
objInstance In colInstances 'msgbox objInstance.Caption OSDetect =
objInstance.Caption Next
if OSDetect = "Microsoft Windows XP
Professional" then XP() if OSDetect = "Microsoft Windows 7 Enterprise" then
Seven()
'WINDOWS XP 'your code goes here sub XP() msgbox "XP"
end sub
WScript.Quit
'WINDOWS 7 'your code goes here
sub Seven() mgbox "7" end sub
WScript.Quit
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Δ
Adobe Professional 9 Enterprise Deployment
How to install and uninstall Adobe Pro 9 silently
Install silently
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
msiexec.exe /i "C:\_ResourceFiles\AdobePro9\AcroPro9.ms"
/qb /norestart TRANSFORMS=C:\_ResourceFiles\AdobePro9\AcroPro9.mst
REBOOT=ReallySuppress
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
Un-install silently
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
msiexec /qn /X {AC76BA86-1033-0000-7760-000000000004}
/norestart
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
This can be used inside a MSI for enterprise deployment
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
On error
resume next Dim WshShell, objFSO, SystemDrive, AllUsersProgramsPath,
AllUsersDesktopPath, oShortCut
set filesys =
CreateObject("Scripting.FileSystemObject") set WshShell =
WScript.CreateObject("WScript.Shell") set objFSO =
CreateObject("Scripting.FileSystemObject")
On Error Resume Next
Dim strComputer, OSDetect, objWMIService, colInstances strComputer = "."
Const wbemFlagReturnImmediately = &h10 Const wbemFlagForwardOnly = &h20
Set objWMIService = GetObject("winmgmts://" & strComputer & "/root/CIMV2" )
Set colInstances = objWMIService.ExecQuery( "SELECT * FROM
Win32_OperatingSystem", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly )
For Each objInstance In colInstances 'msgbox objInstance.Caption
OSDetect = objInstance.Caption Next
if OSDetect = "Microsoft Windows
XP Professional" then XP() if objInstance.Caption = "Microsoft Windows 7
Enterprise" then Seven()
'W I N D O W S X P
Sub XP
'msgbox "xp" SystemDrive = WshShell.ExpandEnvironmentStrings("%Systemdrive%")
AllUsersProgramsPath = SystemDrive & "\Documents and Settings\ All Users\Start
Menu\Programs" AllUsersDesktopPath = SystemDrive & "\Documents and
Settings\All Users\Desktop"
'INSTALL 'CHECKS TO SEE IF ACROPRO9.MSI
EXIST - IF EXIST EXECUTE INSTALLATION ROUTINE If
filesys.FileExists("C:\_ResourceFiles\AdobePro9\AcroPro9.msi") THEN On error
resume next
'MSIs TO LAUNCH 'INSTALLS ADOBE PRO 9 strCommand =
"cmd /c c:\windows\system32\msiexec.exe /i
"&CHR(34)&"C:\_ResourceFiles\AdobePro9\AcroPro9.msi"&CHR(34)&" /qb /norestart
TRANSFORMS=C:\_ResourceFiles\AdobePro9\AcroPro9.mst REBOOT=ReallySuppress "
'msgbox strCommand WshShell.Run strCommand, 0, True
'WshShell.Run "cmd
/c c:\windows\system32\msiexec
TRANSFORM="&chr(34)&"c:\ResourceFiles\AdobePro9\AcroPro9.mst"&chr(34)&" /i"&
""C:\_ResourceFiles\AdobePro9\AcroPro9.msi"" /qn /norestart", 0, True
'CLEAR VARIABLES set AllUsersDesktopPath = "" set AllUsersProgramsPath =
"" set SystemDrive = "" set OSDetect = "" set colInstances = "" set
objWMIService = "" set objFSO = "" set WshShell = "" set filesys = ""
WScript.Quit End if
'UNINSTALL 'CHECKS TO SEE IF ACROPRO9.MSI EXIST
- IF NOT EXIST EXECUTE UNINSTALL ROUTINE 'THIS WILL BE THE UNINSTALLATION
ROUTINE If NOT filesys.FileExists("C:\_ResourceFiles\AdobePro9\AcroPro9.msi")
THEN on error resume next WshShell.Run "msiexec /X
{AC76BA86-1033-0000-7760-000000000004} /qb /norestart", 0, True End If
If objFSO.FileExists ("c:\documents and settings\all users\start
menu\programs\ Adobe Acrobat 9 Pro.lnk") Then On error resume next
objFSO.DeleteFile ("c:\documents and settings\all users\start
menu\programs\ Adobe Acrobat 9 Pro.lnk"), False End If
If
objFSO.FileExists ("c:\documents and settings\all users\start
menu\programs\ Acrobat Distiller 9.lnk") Then On error resume next
objFSO.DeleteFile ("c:\documents and settings\all users\start
menu\programs\ Acrobat Distiller 9.lnk"), False End If
'CLEAR VARIABLES
set AllUsersDesktopPath = "" set AllUsersProgramsPath = "" set SystemDrive
= "" set OSDetect = "" set colInstances = "" set objWMIService = ""
set objFSO = "" set WshShell = "" set filesys = ""
WSCRIPT.QUIT
End Sub
'W I N D O W S 7 Sub SEVEN() On error resume
next
SystemDrive = WshShell.ExpandEnvironmentStrings("%Systemdrive%")
AllUsersProgramsPath = SystemDrive & "\Users\All Users\Start Menu\Programs"
AllUsersDesktopPath = SystemDrive & "\Users\All Users\Desktop"
'INSTALL
'CHECKS TO SEE IF ACROPRO9.MSI EXIST - IF EXIST EXECUTE INSTALLATION ROUTINE
If filesys.FileExists("C:\_ResourceFiles\AdobePro9\AcroPro9.msi") THEN On
error resume next
'MSIs TO LAUNCH 'INSTALLS ADOBE PRO 9 strCommand
= "cmd /c c:\windows\system32\msiexec.exe /i
"&CHR(34)&"C:\_ResourceFiles\AdobePro9\AcroPro9.msi"&CHR(34)&" /qb /norestart
TRANSFORMS=C:\_ResourceFiles\AdobePro9\AcroPro9.mst REBOOT=ReallySuppress"
'msgbox strCommand WshShell.Run strCommand, 0, True
'CLEAR VARIABLES
set AllUsersDesktopPath = "" set AllUsersProgramsPath = "" set SystemDrive
= "" set OSDetect = "" set colInstances = "" set objWMIService = ""
set objFSO = "" set WshShell = "" set filesys = "" WScript.Quit End
if
'UNINSTALL 'CHECKS TO SEE IF ACROPRO9.MSI EXIST - IF NOT EXIST
EXECUTE UNINSTALL ROUTINE 'THIS WILL BE THE UNINSTALLATION ROUTINE If NOT
filesys.FileExists("C:\_ResourceFiles\AdobePro9\AcroPro9.msi") THEN on error
resume next
WshShell.Run "msiexec /X
{AC76BA86-1033-0000-7760-000000000004} /qb /norestart", 0, True
If
objFSO.FileExists ("c:\Users\all users\start menu\programs\Adobe Acrobat 9
Pro.lnk") Then On error resume next objFSO.DeleteFile ("c:\Users\all
users\start menu\programs\Adobe Acrobat 9 Pro.lnk"), False End If
If
objFSO.FileExists ("c:\Users\all users\start menu\programs\Acrobat Distiller
9.lnk") Then On error resume next objFSO.DeleteFile ("c:\Users\all
users\start menu\programs\Acrobat Distiller 9.lnk"), False End If
'CLEAR VARIABLES set AllUsersDesktopPath = "" set AllUsersProgramsPath =
"" set SystemDrive = "" set OSDetect = "" set colInstances = "" set
objWMIService = "" set objFSO = "" set WshShell = "" set filesys = ""
WSCRIPT.QUIT End If End Sub
WSCRIPT.QUIT
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp)
|
![bar1](http://eddiejackson.net/web_images/lightgraybar.bmp) |
|
..About
..I'm a Computer ..Systems Engineer
..Living and loving life ........................................
..Author
...
|