Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 



Use Cmd.exe's Start Command to Simplify Setup Automation

Achieve small-scale software deployment without errors or omissions
RSS
Subscribe to Windows IT Pro | See More Windows OSs Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

You could use the /d option if the directory path had spaces in it, but here our problem is the executable itself. Start offers no way to specify that the quoted string is really the path.

There are two solutions to this problem. One is to provide a quoted string first. For GUI installers, the title won’t matter, but you must provide a quoted title string initially so that Windows will interpret the quoted command path correctly. We can modify the nonfunctional batch file line by adding a quoted string to make it work:

start "" /w "z:\dsp\misc\Acme
  Shipping.exe"

Another alternative is to rename the setup file. This is useful anyway for rarely visited networks, because you can add versioning information to the title while you’re at it, as well as a string to identify the executable as a setup file. If you pick a name such as AcmeShippingSetupv5.1.exe, you get an additional bonus: Windows Server 2008 and Windows Vista will automatically prompt for privilege elevation when invoking an application that has the word “setup,” “install,” or “update” in its name, ensuring that the application installs properly. As a result, if you later do click-and-run installations you’ll get helpful prompting.

Add Command-Line Options
When you use Start to run an application, Start passes everything that follows the application name to the application as arguments, so adding command-line options is straightforward. Suppose you’re installing Windows Defender from the file WindowsDefender. msi. Windows Installer packages universally support certain command-line options. For example, /log followed by a colon and the name of a log file records installation details to the named log. So, if you wanted to log details to c:\install.log and weren’t using the Start command, you could do so by executing the command

z:\dsp\core\WindowsDefender.msi
  /log:c:\install.log

You use precisely the same command if you’re executing it with the Start command. If you want to start the installation and wait, you just use this:

start /w z:\dsp\core\Windows
  Defender.msi /log:c:\install.log

The only special case is if an argument needs quotes. You can use the same technique I demonstrated in the section about handling paths with spaces and include an initial empty quoted string. Therefore, if you were logging installation data to C: Install Records.log, you would use a Start command such as

start "" /w z:\dsp\core  WindowsDefender.msi /log:"C:\Install
  Records.log"

Simple Automation in Minutes
What makes Start commands especially nice is that when you’re ready to perform a sequence of installations, you simply put all the Start commands into a text file—each command on its own line in the order you want to run it, then save the file with a .bat or .cmd extension. You can save the batch file to a network folder located above all the installation media you use, to make it easy to locate each time you need to add or remove a standard installation item.

Given a large infrastructure and budget, a tool such as SMS is still a winner, not least because it does other things in addition to automating software setup. But when you don’t have that tool, using a batch file with the Start command returns a lot of value for the investment of only a little time.

End of Article

   Previous  1  [2]  Next  


Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
CES 2009: Ballmer Announces Windows 7, Windows Live, Live Search Milestones

During his first-ever Consumer Electronics Show (CES) 2009 keynote address last night in Las Vegas, Microsoft CEO Steve Ballmer announced the pending public availability of a feature-complete Windows 7, the final version of Windows Live Essentials, and ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

10 Reasons to Deploy Windows Vista

The decision to upgrade your XP systems to Vista is simple when you consider features such as easier backup, a great desktop search, and vastly improved security options. ...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

Cloud Computing Forum: Integrating Software, Server and Storage as a Service into Your Enterprise IT Delivery Model

Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2009 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing