automaticall run diskpart commands after boot up with RAMDISK

G

Greg Chu The Small

hi, I remotely boot into ramdisk,

If I have several diskpart commands that I want to run after it boots up. Do
I just create a command file and name it mycommand.cmd and put on
c:\mycommand.cmd and configure registry to use runonce and pointing to the
c:\mycommand.cmd?

So if I want to run different commands, I just change the content of the
mycommand.cmd.

Any one has a better idea?
Thanks!

Greg
 
S

Slobodan Brcin \(eMVP\)

Hi Greg,

I have no ides what cmd file is but you can create .bat file.
Put call to diskpart.exe and give it a script file as input.

If you want to boot XPe from network for partitioning and formatting HDD, there are few things that you will need to change in
registry so it can work.

Also use format with undocumented /y switch.

Regards,
Slobodan
 
G

Greg Chu The Small

Would you elaborate more about

"If you want to boot XPe from network for partitioning and formatting HDD,
there are few things that you will need to change in registry so it can
work."

This is exactly what I want to do!
I boot using remote boot manager through PXE.
Then I need to formate drive and create new partitions, then copy the real
XPE image over.

Thanks!

Greg

Slobodan Brcin (eMVP) said:
Hi Greg,

I have no ides what cmd file is but you can create .bat file.
Put call to diskpart.exe and give it a script file as input.

If you want to boot XPe from network for partitioning and formatting HDD,
there are few things that you will need to change in
 
G

Greg Chu The Small

Ok, I can run diskpart now on the command line.
Do you have any sample script file for diskpart that
will format the hard drive and create partions?
Also, do I need NTFS format tools or NTFS format?

Also, when system boots into RAMDISK, do you put this bat file in the
runonce or in run of the registry, or any other better place to triggle the
bat file to run diskpart.
Thanks!
Your help is greatly appreicated!

Greg
 
S

Slobodan Brcin \(eMVP\)

Hi Greg,

Use google I have posted somewhere .bat and script file that will do partitioning and formatting. But you should be able to write it
yourself in less than half an hour.

Only if you will use NTFS.

run, runonce, manually it is up to you. I'm using custom install program we made that does all reimaging things. It is started as
shell and it is a configuration wizard actually.

Regards,
Slobodan
 
G

Greg Chu The Small

My diskpart is not working now after I added NTFS format tools. It only
works for few seconds then stopped working. Any clue?
Thanks!

Greg
Slobodan Brcin (eMVP) said:
Hi Greg,

Use google I have posted somewhere .bat and script file that will do
partitioning and formatting. But you should be able to write it
yourself in less than half an hour.

Only if you will use NTFS.

run, runonce, manually it is up to you. I'm using custom install program
we made that does all reimaging things. It is started as
 
S

Slobodan Brcin \(eMVP\)

Hi Greg,
My diskpart is not working now after I added NTFS format tools. It only
works for few seconds then stopped working. Any clue?

Not really.
But first option you call should be one that will clean MBR with override attribute.
If this passes then I don't see how NTFS could influence diskpart.

Best regards,
Slobodan
 
G

Greg Chu The Small

It works if the image is on the regular hard drive.
The problem is when I made a sdi file from it, and use remote boot into
ramdisk. It is not working on ramdisk.
I have deleted the

HLKM\System\Setup\SystemPartition
HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices

According to other postings.

But still do not work, it workd for me for a while then it quit. After I add
more components.

It is very frustrating!

Any other suggestions?

Thanks!
 
G

Greg Chu The Small

I finally figured out. if the hard drive itself has problem then diskpart
return the message.
"the disk management services could not complete the operation"
 
G

Greg Chu The Small

I finally figured out. if the hard drive itself has problem then diskpart
return the message.
"the disk management services could not complete the operation"
 
S

Slobodan Brcin \(eMVP\)

Hi Greg,

I had one similar bad HDD, but we replaced it so I was not able to look into the problem deeper.

Regards,
Slobodan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top