Quick-Start for using Tasks in SmartDeploy

The SmartDeploy Answer File wizard provides an opportunity to run commands in different phases of deployment. Here’s a quick reference to get you started with running batch and PowerShell scripts.

First, we recommend copying your scripts, or software packages to a location on your Reference VM, such as C:\Temp\ before you capture your image. This simplifies the process by eliminating the need to authenticate when accessing network shares. (Note: You can add del %0 at the end of your batch script to make it delete itself!)

To execute a batch script named MyScript.bat in the C:\Temp\ folder at the First Logon phase, the command will be:

        cmd.exe /c C:\Temp\MyScript.bat

If this were a VBS script. The command would be:

        wscript.exe C:\Temp\MyScript.vbs

If this were a PowerShell script. The command would be:

        powershell.exe -command C:\Temp\MyScript.ps1

Software packages can be run as normal. For example, a task running an A/V setup application silently may look like this:

                C:\Temp\AVSetup.exe /s /norestart

If you've already captured your image, you can include scripts and installation packages on your media, and configure your Answer File tasks to run it from there. To do that:

  1. Edit your Answer File Task(s) so that the command uses %SmartDeploy_Media%\z\ for the folder.
    1. Cmd.exe /c %SmartDeploy_Media%\z\MyScript.bat
    2. wscript.exe %SmartDeploy_Media%\z\MyScript.vbs
  2. Organize the scripts or installation packages you want to include on your media into a folder.
  3. Start the Media Wizard to create media.
  4. After selecting your Answer File, click Browse for Optional Files and browse to and select the folder containing your scripts/installation packages and click OK.
  5. Complete the Media Wizard as you normally would.
  6. Confirm your files are in the z folder on your media.
  • 37
  • 31-Jul-2019