none
How do I run two command line commands from a batch file in an MDT task sequence?

    Question

  • I am using MDT to prep new Dell computers at my job.  One of the task sequences installs Dell Command | Update (DCU), a utility that will look for updated drivers.  As part of the installation process I want to update the DCU policy that determine when it looks for updates.  To do that I need to run a program on the computer that I'm prepping that will import the policy file.  I'm trying to do all of this with a batch file that MDT runs.  The batch file is able to install DCU and copy the policy file to the target computer.  I don't know how to get the DCU Command Line Interface program (dcu-cli.exe) to run on the target computer and import the policy.  If I was sitting at the target computer, I could open a Administrator command prompt and do what I need to do with the following two commands:

    cd c:\program files (x86)\dell\CommandUpdate\
    dcu-cli.exe /import /policy c:\Policy.xml

    How do I get these two commands to run on the target computer as part of an MDT task sequence?

    Monday, June 04, 2018 3:04 PM

All replies

  • Add two command prompt steps in the task sequence?

    Best Regards,

    Jesper Vindum, Denmark

    Systems Administrator

    Help the forum: Monitor(alert) your threads and vote helpful replies or mark them as answer, if it helps solving your problem.

    Tuesday, June 05, 2018 9:44 AM
  • Alternatively, create a script (batch, PowerShell, ...) which executes the command line and evaluates return code. 

    Actually, you do not need two command lines as you can combine these two steps into one (just make sure to specify working directory in the run command line step, otherwise DCU may not find your policy file).


    Cheers,
    Anton

    Vacuum Breather Blog | Wing Commander Saga | Twitter

    Note: Posts are provided "AS IS" without warranty of any kind. If posts are helpful please don't forget to rate them as "Helpful" or as "Answer".

    Tuesday, June 05, 2018 10:16 AM
  • Thanks.  Can you tell me how to do this or point me to some documentation that can help me?  (I'm new to this.)
    Tuesday, June 05, 2018 1:22 PM
  • Something along these lines should work: https://social.technet.microsoft.com/Forums/en-US/4da687d1-197b-4a17-9ad4-13734bf8b2e6/run-exe-in-task-sequence?forum=mdt

    Let me know if you need additional guidance.


    Cheers,
    Anton

    Vacuum Breather Blog | Wing Commander Saga | Twitter

    Note: Posts are provided "AS IS" without warranty of any kind. If posts are helpful please don't forget to rate them as "Helpful" or as "Answer".

    Tuesday, June 05, 2018 1:46 PM
  • Thanks.  If I do that, will those two commands run on the client computer?
    Tuesday, June 05, 2018 2:36 PM
  • Yes,

    the task sequence is copied to the client computer, and will run until no more steps are left.


    Best Regards,

    Jesper Vindum, Denmark

    Systems Administrator

    Help the forum: Monitor(alert) your threads and vote helpful replies or mark them as answer, if it helps solving your problem.

    Tuesday, June 05, 2018 2:49 PM
  • Thanks.  I've tried everything I can think of and it isn't working.  I am able to successfully copy the policy and a batch file to the target computer.  If I manually run (i.e. run the normal way by typing on the keyboard, not with MDT) the batch file, it successfully imports the policy.  So I know my batch file is good.  I am using my task sequence to copy the policy and the batch file.  It then runs a command line that starts in C:\ and issues the command, dcu-cli.bat, because I want it to run the batch file.  However, the batch file doesn't run, I get an error, and the task sequence stops.

    ERROR, application GUID {1c3db3af-98e3-4d86-be8d-eac1911cb65e} not found in application list, unable to execute

    Litetouch deployment failed, Return Code = -2147467259 0x80004005

    CreateProcess failed.  Code(0x80070002)

    Command line execution failed(80070002)

    Failed to run the action: Import DCU policy settings.

    The system cannot find the file specified.  (Error: 80070002; Souce; Windows)

    The execution of the group (State Restore) has failed and the execution has been aborted. An action failed.

    Operation aborted (Error: 80004004; Source: Windows)

    ...

    Any idea what I'm doing wrong?

    Thanks again!


    • Edited by jconrod Tuesday, June 05, 2018 8:47 PM
    Tuesday, June 05, 2018 7:51 PM
  • well,

    it says 'The system cannot find the file specified'

    How did you create your step?


    Best Regards,

    Jesper Vindum, Denmark

    Systems Administrator

    Help the forum: Monitor(alert) your threads and vote helpful replies or mark them as answer, if it helps solving your problem.

    Sunday, June 10, 2018 8:27 AM
  • Thanks for trying to help.  The problem is no longer happening.  I don't know what I changed to make it go away, but I'm not going to worry about it any more.  
    Monday, June 11, 2018 1:44 PM
  • Hey..

    Have you tried to copy the batch file into the device and execute it from that local path via Task Sequence?

     

    Wednesday, June 13, 2018 3:47 PM