Jump to content

Format Drive with WinPE


mdnchauhan

Recommended Posts

Hi all,

I am creating one application that run on WinPE.

I made my application(myExe.exe) using vc++ and I create ISO by going through following steps:

1- copype.cmd x86 D:\WinPeExe

2- imagex /mountrw D:\WinPeExe\winpe.wim 1 D:\WinPeExe\mount

3- copy myExe to mount\windows\System32

8- Winpeshl.ini to mount\windows\syetm32\ :-

I changed winpeshl.ini by doing:

[LaunchApp]

AppPath = %SYSTEMROOT%\System32\myExe.exe

[LaunchApps]

9- peimg /prep D:\WinPeExe\mount\windows

10- imagex /boot /compress max /capture D:\WinPeExe\mount D:\WinPeExe\boot.wim "My_Image"

11- imagex /unmount D:\WinPeExe\mount /commit

12- copy D:\WinPeExe\boot.wim D:\WinPeExe\ISO\sources\boot.wim

13- oscdimg -n -bD:\WinPeExe\etfsboot.com D:\WinPeExe\ISO D:\WinPeExe\WinPeExe.iso

Now when I boot my machine with WinPE then meExe.exe run, In my exe there is a tree control that shows all the volumes of my hard drive.

when I click on any volume it expand.

But if the volume is not formatted it shows a message that the "Drive is not formatted. Do you want to format it now?" this is the message of WinPE that comes itself. If I click on "Format now" it prompt another message "Can not format the drive".

I am stuck in avoiding these messages. OR how can I format the drive when I click on "Format now". I s there some extra steps need to done when I am making ISO image. Because WinPE itself prompt this message so I am not able to trace it or format it at that moment.

I need your suggestion.

Thanks.

Link to comment
Share on other sites


Hi all,

I am creating one application that run on WinPE.

I made my application(myExe.exe) using vc++ and I create ISO by going through following steps:

1- copype.cmd x86 D:\WinPeExe

2- imagex /mountrw D:\WinPeExe\winpe.wim 1 D:\WinPeExe\mount

3- copy myExe to mount\windows\System32

8- Winpeshl.ini to mount\windows\syetm32\ :-

I changed winpeshl.ini by doing:

[LaunchApp]

AppPath = %SYSTEMROOT%\System32\myExe.exe

[LaunchApps]

9- peimg /prep D:\WinPeExe\mount\windows

10- imagex /boot /compress max /capture D:\WinPeExe\mount D:\WinPeExe\boot.wim "My_Image"

11- imagex /unmount D:\WinPeExe\mount /commit

12- copy D:\WinPeExe\boot.wim D:\WinPeExe\ISO\sources\boot.wim

13- oscdimg -n -bD:\WinPeExe\etfsboot.com D:\WinPeExe\ISO D:\WinPeExe\WinPeExe.iso

Now when I boot my machine with WinPE then meExe.exe run, In my exe there is a tree control that shows all the volumes of my hard drive.

when I click on any volume it expand.

But if the volume is not formatted it shows a message that the "Drive is not formatted. Do you want to format it now?" this is the message of WinPE that comes itself. If I click on "Format now" it prompt another message "Can not format the drive".

I am stuck in avoiding these messages. OR how can I format the drive when I click on "Format now". I s there some extra steps need to done when I am making ISO image. Because WinPE itself prompt this message so I am not able to trace it or format it at that moment.

I need your suggestion.

Thanks.

Try diskpart /s config.txt before myexe.exe

config.txt

-----------------------

SELECT DISK 0

CLEAN

CREATE PART PRI

SELECT PART 1

ACTIVE

ASSIGN LETTER=C:

FORMAT FS=NTFS QUICK

EXIT

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...