简体   繁体   中英

How can I run a batch script in 'Deployment Tools Command Prompt' (to make WinPE iso)?

I want to run a batch script inside of the deployment tools command prompt (part of the Windows AIK) to create a WinPE iso. I went through the steps to prep the media and created a script to navigate to the right directory and then run the oscdimg.exe tool.

The problem is that it runs in a normal command prompt, not the deployment tools command prompt. Is it possible to write a script that will run in the deployment tools command prompt instead of the regular command prompt?

My basic script:

@echo off
@echo Running OSCDIMG to create a WinPE amd64 iso in f:\OtherItems\view_stores\WinPE7\winpe.iso
f:
cd \OtherItems\view_stores\WinPE7
oscdimg.exe -n -bf:\OtherItems\view_stores\WinPE7\etfsboot.com f:\OtherItems\view_stores\WinPE7\ISO f:\OtherItems\view_stores\WinPE7\winpe.iso
@echo **********************************************************************
@echo Done.
@echo
pause

If you look at the Properties of 'Deployment Tools Command Prompt' the target is:

C:\Windows\System32\cmd.exe /k "C:\Program Files\Windows AIK\Tools\PETools\pesetenv.cmd"

So it's not a separate program, it's a batch run in the regular cmd prompt.

You can take the content of "pesetenv.cmd" and use it as a prefix to your batch:

Now the Deployment Tools commands should work as expected.

EDIT: Scratch the above, I don't know why I thought that was doing something. Adding the full path to oscdimg.exe and imagex.exe is what works for me.

C:\Program Files\Windows AIK\Tools\x86\oscdimg.exe -n -bf:\OtherItems\view_stores\WinPE7\etfsboot.com f:\OtherItems\view_stores\WinPE7\ISO f:\OtherItems\view_stores\WinPE7\winpe.iso

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM