Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Need Help with Batch File


06 Jul 2010   #1

 
 
Need Help with Batch File

Hi,
I have following three commands that I want to run in a batch file (at x:\Windows\system32 and I am at the correct rirectory by default), commands are as:
bcdedit /set {default} device partition=c:
bcdedit /set {default} osdevice partition=c:
bcdedit /set {bootmgr} device partition=c:

I tried to write batch file but when I call it simply shows me the above commands but not worked for me, so please correct me what is the wrong with my batch file. Here is my Batch file that I created.
@echo off
echo cd x:\Windows\system32
echo bcdedit /set {default} device partition=c:
echo bcdedit /set {default} osdevice partition=c:
echo bcdedit /set {bootmgr} device partition=c:

Please help in this regards.



My System SpecsSystem Spec
.

06 Jul 2010   #2
Microsoft MVP

W 7 64-bit Ultimate
 
 

Hello N A Malik.



Maybe you can get some ideas from the tutorial at the link below; be sure to keep us informed.


BCDEDIT - How to Use
My System SpecsSystem Spec
06 Jul 2010   #3

Windows 7 Pro
 
 

Quote   Quote: Originally Posted by N A Malik View Post
Hi,
I have following three commands that I want to run in a batch file (at x:\Windows\system32 and I am at the correct rirectory by default), commands are as:
bcdedit /set {default} device partition=c:
bcdedit /set {default} osdevice partition=c:
bcdedit /set {bootmgr} device partition=c:

I tried to write batch file but when I call it simply shows me the above commands but not worked for me, so please correct me what is the wrong with my batch file. Here is my Batch file that I created.
@echo off
echo cd x:\Windows\system32
echo bcdedit /set {default} device partition=c:
echo bcdedit /set {default} osdevice partition=c:
echo bcdedit /set {bootmgr} device partition=c:

Please help in this regards.
I am assuming you tested each of the commands manually in a DOS (command) window and they work correct?

If I am reading your post correctly you have the echo in front of each line in the batch file which all that does is display the line following the echo on the display without running them.

If I am correct remove the echo from each of the 3 lines and try it again.
My System SpecsSystem Spec
.


06 Jul 2010   #4

Windows7 Ultimate 64bit
 
 

Remove the "echo" command from every line (except @echo off), then it will run. "echo" means print the passed argument to the standard output (display).

zzz2496
My System SpecsSystem Spec
06 Jul 2010   #5

Windows 7 Pro
 
 

Quote   Quote: Originally Posted by zzz2496 View Post
Remove the "echo" command from every line (except @echo off), then it will run. "echo" means print the passed argument to the standard output (display).

zzz2496
Guess we hit it at the same time.
My System SpecsSystem Spec
08 Jul 2010   #6

 
 

Dear All !

I really appreciate the time and helpful tips. Tomorow I am going to test that (without echo) and will get back to you guys to share my experience.

Thank you once again!
Malik
My System SpecsSystem Spec
08 Jul 2010   #7
Microsoft MVP

W 7 64-bit Ultimate
 
 

Thanks for posting back, we'll be here.
My System SpecsSystem Spec
08 Jul 2010   #8

Win7/XP
 
 

I'm curious why you are having to batch any boot control.

Regardless...
I would suggest that if these are one-off changes, you'd be best served by using easybcd.
It makes life soooo much easier.
Download EasyBCD 1.7.2 - NeoSmart Technologies (and its free!)
My System SpecsSystem Spec
08 Jul 2010   #9
OEM

OS3.5
 
 

Quote   Quote: Originally Posted by dood View Post
I'm curious why you are having to batch any boot control.

Regardless...
I would suggest that if these are one-off changes, you'd be best served by using easybcd.
It makes life soooo much easier.
Download EasyBCD 1.7.2 - NeoSmart Technologies (and its free!)
I'd second that, I'm curious myself as to what your trying to do. It should only have to be done once unless your doing some dual booting in a way I'm not thinking of.

...dunno, please advise...
My System SpecsSystem Spec
08 Jul 2010   #10

Microsoft Community Contributor Award Recipient

Vista x64 / 7 X64
 
 

I would think he is running it from pe, and using either as a fix, or as part of an automated instalation routine .
My System SpecsSystem Spec
Reply

 Need Help with Batch File




Thread Tools




Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 01:13 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33