How To: List Task Sequence Environment Variables and Values

(another encore presentation from my old blog site…)

From the TechNet forums, this is an example for how to display Task Sequence Environment Variables and Values using VBScript:

Set oTSEnv = CreateObject(“Microsoft.SMS.TSEnvironment”)
For Each oVar In oTSEnv.GetVariables
WScript.Echo oVar & “=” & oTSEnv(oVar)

You could save those two lines of code to “ShowTSVars.vbs”, and then when you want, simply run “cscript //nologo ShowTSVars.vbs >vars.txt” to write all variables to vars.txt.

Windows 8 – A simple start screen button

I’ve been spending some time testing Windows 8 and Server 2012 lately, mostly on virtual machines. If you’ve worked with either OS in a VM (or even Remote Desktop), you may have noticed the challenge in hitting the start screen button. . .er orb.   It is very easy on a real monitor, because you simply move the mouse to the bottom-left corner of the screen. But on a VM, you can quickly move from the bottom-left corner of the VM to the applications on ‘the real’ system.  So to make this a little easier for myself, I created a  shortcut to launch the start screen:

Task bar in Windows 8 CP

All that’s required is a simple VBScript using my all-time non-favorite method “Sendkeys.” Here’s the code:

Set WshShell = WScript.CreateObject(“WScript.Shell”)
WshShell.SendKeys “^{ESC}”

That’s it – just pressing [CTRL]+[ESC] will launch the start screen (as well as the start menu on previous versions of windows). So all you need to do is create a shortcut to run that VBScript.

Of course I wanted to automate this a little, so attached is a .zip file that you can deploy in a ConfigMgr/MDT task sequence. Simply run “InstallStart.cmd” and it will configure everything for you.

Download the install source.

As you may  know, these shortcuts are part of the user profile, that’s why we went to the extra trouble to set this shortcut for every profile. There are some handy examples in the code. ConfigureActiveSetup.reg shows you how to launch a command to run one time for each user that logs on (kind-of like a runonce per user) – this will call the PintoTaskBar.vbs to pin the shortcut to the task bar (note, if Windows is configured to a different setting than English, you may need to modify PinToTaskBar to find the equivalent action for your language). ShowStart.vbs executes the SendKeys command.  **After running the script, logoff/on for the icon to appear.


Here’s information for how to create a “Shutdown” tile in Metro.