Customisations.vbs – Sample 1

‘****************************************************************************
‘*  Name: Customisations.vbs
‘*
‘*  Description:  This script is used to perform the following functions:
‘*                    – Carry out Final Customisations
‘*
‘****************************************************************************

‘****************************************************************************
‘ Declare Objects & Variables
‘****************************************************************************
‘Set Option Explicit
Option Explicit

‘Set System to ignore errors and continue
On Error Resume Next

‘Declare Variable for Shell Object
Dim WshShell
Set WshShell = WScript.CreateObject(“Wscript.Shell”)

‘Declare Variable for Filesystem Object
Dim objFSO
Set objFSO = WScript.CreateObject(“Scripting.FileSystemObject”)

‘Declare Network Object
Dim wshNetwork
Set wshNetwork = CreateObject(“WScript.Network”)

‘Delcare Variables and Set Object to allow disabling of wireless card
Dim strComputer, strDevice, objWMIService, colItems, ObjItem, colItems2, obj, strmanufacturer, strModel, strMakeModel
strComputer = “.”
Set objWMIService = GetObject(“winmgmts:” & strComputer & “rootcimv2”)
Set colItems = objWMIService.ExecQuery(“Select * from Win32_NetworkAdapter”)
Set colItems2 = objWMIService.ExecQuery(“Select * from Win32_ComputerSystem”, , 48)

‘********************************************************************************************************
‘ Main Body Of Script    
‘********************************************************************************************************
‘Gather Current SourcePath
Dim SourcePath
SourcePath = Left(WScript.ScriptFullName, Len(WScript.ScriptFullName) – Len(WScript.ScriptName))

For Each obj In colItems2
strmanufacturer = Trim(obj.Manufacturer)
strModel = TRim(obj.Model)
Next
DIm objSMBIOS, STag
For Each objSMBIOS in objWMIService.ExecQuery(“Select * from Win32_SystemEnclosure”)
STag = objSMBIOS.SerialNumber
Next

strMakeModel = strmanufacturer & ” ” & strModel & ” (Servicetag :” & STag & “)”

objFSO.CopyFile SourcePath & “OEMLOGO.bmp”, “C:WindowsSystem32”, True
WshShell.RegWrite “HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionOEMInformationLogo”, “C:WindowsSystem32OEMLOGO.BMP”,”REG_SZ”
WshShell.RegWrite “HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionOEMInformationManufacturer”, “Your Company Name YourORGName”,”REG_SZ”
WshShell.RegWrite “HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionOEMInformationModel”, “SOE Version : CompanyName  Windows 7 32-bit Rich SOE Release Version 5.0 Beta 1″,”REG_SZ”
‘WshShell.RegWrite “HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionOEMInformationModel”, strMakeModel,”REG_SZ”

‘Show MyComputer icon on desktop
WshShell.RegWrite “HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerHideDesktopIconsNewStartPanel{20D04FE0-3AEA-1069-A2D8-08002B30309D}”,”0″,”REG_DWORD”
‘Show MyDocs icon on desktop
‘WshShell.RegWrite “HKLMSoftwareMicrosoftWindowsCurrentVersionExplorerHideDesktopIconsNewStartPanel{59031a47-3f72-44a7-89c5-5595fe6b30ee}”,”0″,”REG_DWORD”

‘Remove Games Folder from Start Menu
If objFSO.FolderExists (“C:ProgramDataMicrosoftWindowsstart menuprogramsGames”) then
objFSO.DeleteFolder (“C:ProgramDataMicrosoftWindowsstart menuprogramsGames”), True
End If

‘Remove the easytransfer shortcuts
If objfso.FileExists (“C:ProgramDataMicrosoftWindowsStart MenuProgramsAccessoriesSystem ToolsWindows Easy Transfer Reports.lnk”) Then
objfso.DeleteFile (“C:ProgramDataMicrosoftWindowsStart MenuProgramsAccessoriesSystem ToolsWindows Easy Transfer Reports.lnk”)
End If

If objfso.FileExists (“C:ProgramDataMicrosoftWindowsStart MenuProgramsAccessoriesSystem ToolsWindows Easy Transfer.lnk”) Then
objfso.DeleteFile (“C:ProgramDataMicrosoftWindowsStart MenuProgramsAccessoriesSystem ToolsWindows Easy Transfer.lnk”)
End If

‘Remove the getting started shortcuts
If objfso.FileExists (“C:ProgramDataMicrosoftWindowsStart MenuProgramsAccessoriesWelcome Center.lnk”) Then
objfso.DeleteFile (“C:ProgramDataMicrosoftWindowsStart MenuProgramsAccessoriesWelcome Center.lnk”)
End If

‘Hide Support folder
wshShell.Run “cmd /c attrib +s +h +r c:support”, 1, True

‘PowerCOnfiguration
‘wshShell.Run “cmd /c ” & SourcePath & “Power.bat”, 1, True

‘Hide .Net Framework 4 Extended
WshShell.RegWrite “HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall{0A0CADCF-78DA-33C4-A350-CD51849B9702}SystemComponent”,”1″,”REG_DWORD”
WshShell.RegWrite “HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstallMicrosoft .NET Framework 4 Client ProfileSystemComponent”,”1″,”REG_DWORD”
WshShell.RegWrite “HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstallMicrosoft .NET Framework 4 ExtendedSystemComponent”,”1″,”REG_DWORD”

‘Hide McAfee 4.5
WshShell.RegWrite “HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall{5C1FBBAF-14C8-4A23-A4A7-BCF19A979890}SystemComponent”,”1″,”REG_DWORD”

‘Hide BeCriypt
WshShell.RegWrite “HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall{6D90123F-0011-4014-9378-1FC920E45903}SystemComponent”,”1″,”REG_DWORD”

‘Hide windows device manager
WshShell.RegWrite “HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall{904CCF62-818D-4675-BC76-D37EB399F917}SystemComponent”,”1″,”REG_DWORD”
WshShell.RegWrite “HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall{E7044E25-3038-4A76-9064-344AC038043E}SystemComponent”,”1″,”REG_DWORD”

wshShell.Run “C:WindowsSystem32cScript.exe ” &  SourcePath & “GPOSetGPOs.vbs”, 0, True

wshShell.Run “C:WindowsSystem32cScript.exe ” &  SourcePath & “SecuritySecurity.vbs”, 0, True

‘Change Admin Password
‘wshShell.Run “cmd /c NET user %USERNAME% Passw0rd@123”, 1, True
WScript.sleep 5000

‘Disable IPV6
WshShell.RegWrite “HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTCPIP6ParametersDisabledcomponents”,”255″,”REG_DWORD”
wshShell.Run “cmd /c netsh in teredo set state disable”, 1, True
wshShell.Run “cmd /c netsh in 6to4 set state disable”, 1, True

‘Disable UAC
WshShell.RegWrite “HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystemEnableLUA”,”0″,”REG_DWORD”

‘\\\\\\\\\\Changes on 2011\\\\\\\\\\\\\\

‘add Wlan profile
WshShell.run “cmd /c netsh wlan add profile filename=” & chr(34) & “c:supportscriptsbbtwlan.xml” & chr(34) &  ” interface=” & chr(34) & “wireless Network Connection” & chr(34) & ” user=all”

‘Disable Offline Files
wshShell.Regwrite “HKEY_LOCAL_MACHINESOFTWAREPoliciesMicrosoftWindowsNetcacheEnabled”,”0″,”REG_DWORD”
wshShell.Regwrite “HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesYourORGNamestart”,”4″,”REG_DWORD”

‘Change CD ROM drive letter to Y
wshShell.Run “C:SupportScriptsCDDriveLetter.bat”, 0, True

‘Disable EFS
wshShell.Regwrite “HKEY_LOCAL_MACHINESYSTEMCurrentControlSetPoliciesNtfsDisableEncryption”,”1″,”REG_DWORD”

‘Set DHCP Class ID
wshShell.run “cmd /c ipconfig /setclassid ” & chr(34) & “Local Area Connection” & chr(34) & ” BBTDEVICE”
wshShell.run “cmd /c ipconfig /setclassid ” & chr(34) & “Local Area Connection 2″ & chr(34) & ” BBTDEVICE”
wshShell.run “cmd /c ipconfig /setclassid ” & chr(34) & “Local Area Connection 3″ & chr(34) & ” BBTDEVICE”
wshShell.run “cmd /c ipconfig /setclassid ” & chr(34) & “Local Area Connection 4″ & chr(34) & ” BBTDEVICE”

‘Remove Theme Tab
wshShell.Regwrite “HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionpoliciesExplorerNoThemesTab”,”1″,”REG_DWORD”

‘Remove Context Menu Items
‘Remove Briefcase
wshShell.RegDelete “HKEY_CLASSES_ROOT.bfcShellNew” & “”
‘Remove bitmap
wshShell.RegDelete “HKEY_CLASSES_ROOT.bmpShellNew” & “”
‘Remove Journal
wshShell.RegDelete “HKEY_CLASSES_ROOT.jntjntfileShellNew” & “”
‘Remove SAPShow Container
wshShell.RegDelete “HKEY_CLASSES_ROOT.kepShellNew” & “”
‘Remove Microsoft Office Access Appilication
wshShell.RegDelete “HKEY_CLASSES_ROOT.accdbAccess.Application.14ShellNew” & “”
‘Remove Microsoft Office Power Point Presentation
wshShell.RegDelete “HKEY_CLASSES_ROOT.pptxPowerPoint.Show.12ShellNew” & “”
‘Remove Microsoft Office Publisher Document
wshShell.RegDelete “HKEY_CLASSES_ROOT.pubPublisher.Document.14ShellNew” & “”
‘Remove SAP GUI
wshShell.RegDelete “HKEY_CLASSES_ROOT.sapShellNew” & “”
‘Remove wave file
wshShell.RegDelete “HKEY_CLASSES_ROOT.wavShellNew” & “”
‘Remove zip file
wshShell.RegDelete “HKEY_CLASSES_ROOT.zipShellNew” & “”
‘Remove zipx file
wshShell.RegDelete “HKEY_CLASSES_ROOT.zipxShellNew” & “”

WScript.sleep 5000

‘Hide Payload and Programcache
wshShell.run “cmd /c attrib +s +h +r D:PayLoad”,1,True
wshShell.run “cmd /c attrib +s +h +r D:ProgramCache”,1,True

‘Diable Hide Inactive Buttons
 WshShell.RegWrite “HKLMSOFTWAREMicrosoftWindowsCurrentVersionpoliciesExplorerNoAutoTrayNotify”,”1″,”REG_DWORD”

‘Media Player Customizations
wshShell.Regwrite “HKEY_CURRENT_USERSoftwareMicrosoftMediaPlayerPreferencesDeleteRemovesFromComputer”,”0″,”REG_DWORD”
wshShell.Regwrite “HKEY_CURRENT_USERSoftwareMicrosoftMediaPlayerPreferencesMetadataRetrieval”,”0″,”REG_DWORD”
wshShell.Regwrite “HKEY_CURRENT_USERSoftwareMicrosoftMediaPlayerPreferencesAutoRename”,”0″,”REG_DWORD”
wshShell.Regwrite “HKEY_CURRENT_USERSoftwareMicrosoftMediaPlayerPreferencesFlushRatingsToFiles”,”0″,”REG_DWORD”
wshShell.Regwrite “HKEY_CURRENT_USERSoftwareMicrosoftMediaPlayerPreferencesSilentAcquisition”,”0″,”REG_DWORD”

‘Install Win Rights Management update KB979099

Wshshell.Run “Cmd /c C:supportScriptsWindows6.1-KB979099-x86.msu /quiet /norestart”, 1, True

‘**********************************************************************************************************************************
‘********************************************************************************************
‘**********************************************************************************************************************************

‘Diable Auto Updates in WMP11
WshShell.RegWrite “HKLMSOFTWAREPoliciesMicrosoftWindowsMediaPlayerDisableAutoUpdate”, “1”,”REG_DWORD”

‘\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

‘————————————————————————–
‘ WRITE BUILD INFORMATION REGISTRY KEYS
‘————————————————————————–
Const Platform = “Windows 7 32-bit RICH SOE”
‘Const ServicePackLevel = “”
Const BuildVersion = “5.0”
Const BuildRelease = “CompanyName  Release Version 5.0 Beta 1”
Const BuildID = “CompanyName  Windows 7 32-bit Rich SOE Release Version 5.0 Beta 1”
Const WorkStyle = “Enterprise”
Const Status = “Native”

Dim strRegKey
strRegKey = “HKLMSOFTWAREYourORGName”
WshShell.RegWrite strRegKey&”Platform”, Platform
‘WshShell.RegWrite strRegKey&”ServicePackLevel”, ServicePackLevel
WshShell.RegWrite strRegKey&”BuildVersion”, BuildVersion
WshShell.RegWrite strRegKey&”BuildRelease”, BuildRelease
WshShell.RegWrite strRegKey&”BuildID”, BuildID
WshShell.RegWrite strRegKey&”WorkStyle”, WorkStyle
WshShell.RegWrite strRegKey&”Status”, Status

strRegKey = “HKLMSOFTWAREYourORGNameBuildHistory”
WshShell.RegWrite strRegKey&”OriginalBuildVersion”, BuildVersion

‘Get/Set Date/Time
Dim arrDay, strDay
Dim arrMonth, strMonth
Dim strDateInstalled
arrDay = Array ( “Sunday”, “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”)
arrMonth = Array (“January”, “February”, “March”, “April”, “May”, “June”, “July”, _
               “August”, “September”, “October”, “November”, “December”)
strDay = arrDay(WeekDay(Now)-1)
strMonth = arrMonth(Month(Now)-1)
strDateInstalled = strDay & ” ” & Day(Now) & ” ” & strMonth & “, ” & Year(Now)
WshShell.RegWrite “HKLMSOFTWAREYourORGNameDateInstalled”, strDateInstalled

‘————————————————————————–
‘ BUILD PROCESS FINAL CUSTOMISATIONS
‘————————————————————————–

‘****************************************************************************
‘  User Defined Functions
‘****************************************************************************
Function KeyExists(Key)
Dim Key2
On Error Resume Next
Key2 = WshShell.RegRead(Key)
If Err <> 0 Then
KeyExists = False
Else
KeyExists = True
End If
On Error Goto 0
End Function
‘————————————————————————–
Function DeleteThisFile(FileName)
  If objFSO.FileExists(FileName) Then
    objFSO.DeleteFile FileName,True
  End If
End Function

‘****************************************************************************
‘  Release Objects
‘****************************************************************************
Set WshShell = Nothing
Set objFSO = Nothing

‘***********************
‘*   END OF PROGRAM    *
‘***********************

Leave a Comment