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