• Home  / 

Using applications in MDT 2010 (VBscript vs Batch files)

By arwidmark / January 18, 2011

Over the years I have been answering quite a number of posts from people trying to run batch files in MDT. And as fun as the old batch files ever are, you simply get way more features when converting them into vbscript…

Here is the deal, MDT does support batch files, but batch files has quite many limitations compared with vbscript. The most common issues relates to the working directory and UNC paths, using pushd and “%~dp0” for temporary mappings. Others relate to calling cmd /c before the actual command etc, not to mention the lack of “real” objects…

By converting the batch file into a vbscript we can take advantage of all the object properties in MDT, get a better error handling and logging. Shorthand – it will just work. On top of that we can have a common standard on how we deploy applications.

Here is a sample batchfile from one of the forum posts that installed quicktime 7, the post was about the batch file not working correctly with MDT.

REM Install Application Support first:
AppleApplicationSupport.msi /quiet /passive /norestart

REM Install Quicktime

REM Delete the AutoRun key
reg delete “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run” /v “QuickTime Task” /f

Rather than even spending a minute on debugging the batchfile I converted into a vbscript that you can download: QuickTime 7 installation script for MDT


  1. Create a D:\AppSource\QT\Source folder structure
  2. Copy the Quicktime installation files (msi) to the D:\AppSource\QT\Source folder
  3. Copy the Install-QuickTime.wsf script to D:\AppSource\QT
  4. Create an application in MDT, set the source path to D:\AppSource\QT when importing, and set the command-line to cscript.exe Install-QuickTime.wsf


When deploying the app you get additional logging the in the C:\MININT\SMSOSD\OSDLOGS from the script itself as well as the individual msi installs.

For testing purposes it’s very useful to create a custom task sequence that only installs the QT application, and execute that sequence from the running OS (so that you don’t have to do a full deployment every time you need to test an app).

/ Johan


About the author


tjennings - January 18, 2011

This is great man. I can’t thank you enough, unless of course, you could provide some links to appropriate information/books/training resources for MDT 2010 and vbscript.

I’m currently bookmarking a few places on the web that offer training and searchable indexes for VBS, but any links you could throw in regarding VBS in MDT2010 would be MUCH more helpful and precise.

Thanks again!
Not So Frustrated Now

tjennings - January 18, 2011

Great blog! I just realized that I’ve been using you occasionally for information/tutorials on setting up WDS on server 2008 r2. You’re at the top of many of my Google searches on these topics.

Don’t mean to hound you for links, either, but I believe that it is better to learn and do than to rely on others to do for you.

arwidmark - January 18, 2011

List of MDT 2010 Resources

/ Johan

Seanlv - March 31, 2011

In the step 4, set the command-line to cscript.exe Install-QuickTime.wsf

My question is how to hide the windows when loading cscript.exe?


arwidmark - April 20, 2011

You can wrap cscript in another executable, see this post… disclaimer, I have not tested this myself, but Alex is trustworthy 🙂


Naz - May 19, 2011

Hi Johan,

I should have joined this blog ages ago but better late than never
I have a question – have you posted anywhere on how to create a custom task sequence that install single applications – I have having some issues with installing apps – even though when I install them with the switches on command line it works


arwidmark - May 25, 2011

It’s just about creating a new task sequence, and select the custom template. Then you can go into the task sequence and select the application, or add it as applications001={app-guid-from-the workbench} in customsettings.ini. The app needs to run fully unattended.

/ Johan

RoBL - November 14, 2011

Hi John, Is there a way if 15 applications are offered to select for installation, and let’s say within 10 minutes, if no app is selected the deployment continues to install the OS automatically. Now it will wait for ever…



arwidmark - November 14, 2011

You can certainly customize the deployment wizard to wait, and automatically continue if no selection is made, but for that you need to change the code in the HTA.

/ Johan

Dapim76 - November 21, 2011

Can you use the QTime script for other apps as well? Obviously substituting the executable and so forth. I am new to MDT and I need to get this up fairly quickly and we only have a handful of apps that go on our PCs.

arwidmark - November 22, 2011

Sure, that works fine… If the application have good installer you can also call it directly, I just prefer to use application wrappers for consistency, and to get additional logging.

/ Johan

RobVM - January 12, 2012

The script worked fine for me with QT 7.7.1, after I remmed out the line that deleted the startup registry key. It appears that key doesn’t exist.

Comments are closed