locked
How to use Synchronous Command to execute .bat file.. RRS feed

  • Question

  • Hello everyone:
                   Last week , I wanted to Use RunSynchronous Command to delete a file .So I konw a plan which use a .bat file. But this plan did not succeed.
    Because this command is useless.  
                  
                   The following step is performed at that time:
                   Setp 1: Creat a OEM folder, take the .bat file to this folder.
                   Setp 2: Insert a Runsynchronous Command in pass 4.
                   Setp 3: Input command( c:\XXX.bat )
    Please help me to reslove this problem.
    Thank you!

    Tracy Yang 

    Monday, December 28, 2009 2:55 AM

Answers

  • Using System Image Manager (from the ADK) you can create an answer file that has synchronous commands.

    The setup in the distribution share mentioned above is correct, but the proper way to run a batch file in the sync command is 

    cmd.exe /c <full path>\xyz.bat


    Sean Liming - Book Author: Starter Guide Windows 10 IoT Enterprise - www.annabooks.com / www.seanliming.com

    • Proposed as answer by Sean LimingMVP Thursday, March 29, 2018 10:09 PM
    • Marked as answer by Sean LimingMVP Saturday, November 28, 2020 5:52 PM
    Thursday, March 29, 2018 2:04 PM
  • Hi Tracy,

    Is your .bat file being delivered to the target appropriately?  If so, the problem might be with the synchronous command occuring too early; can you try running it in pass 7 and see if that works?

    If not then there may be a problem with your OEM folder.  To deliver to the root of C the format should be $OEM$\$1\XXX.bat.

    Hopefully this helps solve your issue. 
    -Ben Tucker
    • Proposed as answer by Sean LimingMVP Tuesday, July 13, 2010 4:16 PM
    • Marked as answer by Sean LimingMVP Saturday, November 28, 2020 5:52 PM
    Tuesday, January 5, 2010 9:24 PM
  • You can either use the bat file (which will require copying the files as you found) or directly input the delete command in RunSynchronousCommand. Try using the "RunSynchronousCommand"  in the component "Microsoft-Windows-Deployment". Or you can use the Pass 7 Runsynchronouscommand under "FirstLogonCommand" in component Microsoft-Windows-Shell-Setup. Both should work.
    Sampath
    • Proposed as answer by Sean LimingMVP Tuesday, July 13, 2010 4:16 PM
    • Marked as answer by Sean LimingMVP Saturday, November 28, 2020 5:52 PM
    Thursday, January 7, 2010 1:58 AM

All replies

  • Hi Tracy,

    Is your .bat file being delivered to the target appropriately?  If so, the problem might be with the synchronous command occuring too early; can you try running it in pass 7 and see if that works?

    If not then there may be a problem with your OEM folder.  To deliver to the root of C the format should be $OEM$\$1\XXX.bat.

    Hopefully this helps solve your issue. 
    -Ben Tucker
    • Proposed as answer by Sean LimingMVP Tuesday, July 13, 2010 4:16 PM
    • Marked as answer by Sean LimingMVP Saturday, November 28, 2020 5:52 PM
    Tuesday, January 5, 2010 9:24 PM
  • You can either use the bat file (which will require copying the files as you found) or directly input the delete command in RunSynchronousCommand. Try using the "RunSynchronousCommand"  in the component "Microsoft-Windows-Deployment". Or you can use the Pass 7 Runsynchronouscommand under "FirstLogonCommand" in component Microsoft-Windows-Shell-Setup. Both should work.
    Sampath
    • Proposed as answer by Sean LimingMVP Tuesday, July 13, 2010 4:16 PM
    • Marked as answer by Sean LimingMVP Saturday, November 28, 2020 5:52 PM
    Thursday, January 7, 2010 1:58 AM
  • Can this be implemented during windows 10 ? In the specialize phase of setup?  John
    Thursday, March 29, 2018 7:08 AM
  • Using System Image Manager (from the ADK) you can create an answer file that has synchronous commands.

    The setup in the distribution share mentioned above is correct, but the proper way to run a batch file in the sync command is 

    cmd.exe /c <full path>\xyz.bat


    Sean Liming - Book Author: Starter Guide Windows 10 IoT Enterprise - www.annabooks.com / www.seanliming.com

    • Proposed as answer by Sean LimingMVP Thursday, March 29, 2018 10:09 PM
    • Marked as answer by Sean LimingMVP Saturday, November 28, 2020 5:52 PM
    Thursday, March 29, 2018 2:04 PM