Exploring the functions included in Microsoft.BDD.Utility.dll

While browsing through the MDT 2012 scripts, I noticed that here and there MDT uses functions included in the Microsoft.BDD.Utility.dll which is loaded by ZTIUtility.vbs. A good example is the ZTIGather.wsf where the following function is used to determine whether the system is running UEFI or native BIOS. ‘ Determine if we are running UEFI bIsUEFI = FALSE On Error Resume Next bIsUEFI = oUtility.BDDUtility.IsUEFI On Error Goto 0 So I took Nir Sofer’s DLL Read More …

List Task Sequence Variables and Values Script

For years I have been using the following script from myITforum to list Task Sequence Environment Variables and Values Set oTSEnv = CreateObject("Microsoft.SMS.TSEnvironment") For Each oVar In oTSEnv.GetVariables WScript.Echo oVar & "=" & oTSEnv(oVar) Next Because there are so many variables, the only useful way to use the script is to pipe the output into a file, then open that file and search for the variable and its value. So I have created the created Read More …

Retrieve Windows Boot Time Script

Here’s a small batch script to get the Windows 7 Boot time shown in milliseconds. @echo off FOR /F "Tokens=4" %%a IN (‘%windir%\system32\wevtutil.exe qe Microsoft-Windows-Diagnostics-Performance/Operational /rd:true /f:Text /c:1 /q:"*[System[(EventID = 100)]]"  /e:Events ^| FIND "Duration"’) DO SET BTIME=%%a ECHO Boot Time is : %BTIME% Inspiration for this script came from the article Monitor System Startup Performance in Windows 7 written by Sean Wheeler for WindowsITPro.

Running a Custom Scan with Microsoft Security Essentials using a Batch Script

Here’s a small script I just wrote to perform an antivirus scan against a specified file. @Echo off FOR /F "Tokens=4" %%a IN (‘"C:\Program Files\Microsoft Security Client\AntiMalWare\mpcmdrun.exe" -Scan -ScanType 3 -File C:\TEMP\test1.wim -DisableRemediation’) DO SET THREAT=%%a Echo. if "%THREAT%"=="no" (     color 2F     Echo No Threats Found – All clean     ) ELSE (     color 4F     Echo WARNING! Virus Found ) Echo. pause If all is OK you get the following result Read More …

Extract Path with spaces from Registry value

I’ve been browsing through the Microsoft TechNet Forums to see whether I can learn something new or maybe give someone a helping hand. Now before I am going to show the solution I gave someone, let me first tell you this. It was just before having diner that I read the question and already thought of a possible solution, but then it was time for diner, moving away from my laptop I thought it looks Read More …

BITSAdmin is deprecated in Windows 7 and 2008 R2

Just recently when I created a script using BITSAdmin, I noticed the following text when running the BITSAdmin executable: BITSADMIN is deprecated and is not guaranteed to be available in future versions of Windows. Administrative tools for the BITS service are now provided by BITS PowerShell cmdlets. So BITS with PowerShell landed on my to-look-at list, but just today I came across Ashley McGlone’s Blog – Big Downloads With Powershell which contains a sample script Read More …

Mute Windows System Volume

I came across a forum post where someone asked how to programmatically mute the Windows System volume. So this is what I have found: NirCmd NirCmd from NirSoft is a small command-line utility that contains many smart functions like muting and unmuting the system volume. To mute the system volume, simply run the following command nircmd.exe mutesysvolume 1 and to unmute you run nircmd.exe mutesysvolume 0 With VBScript Another option is to use a VBscript, Read More …

Automated Microsoft Security Essentials Installation

For all those that frequently setup test machines and get tired of manually installing the Microsoft Security Essentials 2.0, here’s a straight forward batch file (even a regular user could use) that does the following: Downloads the Microsoft Security Essential 2.0 (x86) installation source file Installs Microsoft Security Essentials 2.0 Downloads and updates the virus definition signature file   [sourcecode language=”plain”] @ECHO OFF Echo Downloading Microsoft Security Essentials 2.0 (x86) start /wait bitsadmin /TRANSFER MSE20 Read More …

Extracting CAB files from Microsoft Update Standalone Package (MSU)

When manually downloading a Microsoft Security Update or hotfix for Windows 7 (Vista) you typically get a file with an MSU file extension. A file with an MSU extension is a Microsoft Update Standalone package. Microsoft Update Standalone Packages are installed through the Windows Update Standalone Installer WUSA.EXE which is located in the  C:\Windows\system32 folder. If you need to install many updates you could create a script like the one below. SET HOTFIXSRC=<folder that contains Read More …

ToolTip: Application Paths Editor

The Application Paths Editor allows you to add, edit and remove Application Paths. Setting an application path for your favorite application or script allows you to run the application directly from the “Run” dialog at the Start Menu. So assume you have a script called “HelloApp.vbs” which is stored under C:\Program Files\HelloApp without having set an Application Path, you would have to navigate to the scripts folder or type the full path to launch the Read More …