Need Help with Batch File

N A Malik

Banned
Local time
6:49 PM
Messages
22
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 Computer

OS
XP
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 Computer

Computer Manufacturer/Model Number
* BFK Customs *
OS
W 7 64-bit Ultimate
CPU
Intel Q9550 Yorkfield
Motherboard
ASUS P5Q Pro
Memory
8GB Dominator 8500C5D
Graphics Card(s)
ATI : XFX 5870
Sound Card
Realtek HD Audio 7-1
Monitor(s) Displays
1x 47" LCD HDMI & 3x 26" LCD HDMI
Screen Resolution
1920x1080P & 1920x1200
Hard Drives
1x 80GB Intel X25-M G2 SSD : 1x 500GB & 1x 640GB WD Caviar Black(s)
PSU
Corsair 620HX
Case
Cooler Master RC-690
Cooling
Tuniq Tower 120, 2x 140mm and 3x 120mm case fans
Keyboard
Microsoft 500
Mouse
Razer Diamondback 3G
Internet Speed
14 Mb/s
Other Info
1x Koutech 3Gb/s SATA HDD Hot Swap Rack
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 Computer

Computer Manufacturer/Model Number
Dell e6410
OS
Windows 7 Pro
CPU
Intel Core i5 M520 @ 240GHz
Memory
2 Gig
Graphics Card(s)
Intel Grap
Sound Card
Intel Graphics Media Accelerator HD
Monitor(s) Displays
Built in (LapTop)
Screen Resolution
1440x900
Hard Drives
250 Gig STAT
Mouse
Logitech Bluetooth
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 Computer

Computer Manufacturer/Model Number
Self Built
OS
Windows7 Ultimate 64bit
CPU
Intel Core 2 Quad Q6600
Motherboard
Abit IN9-32X-MMAX
Memory
DDR2 Adata 4GB
Graphics Card(s)
Nvidia GeForce GTX 285 1024 and Nvidia GeForce 8800GT 512
Sound Card
Asus Xonar HDAV 1.3
Monitor(s) Displays
Dell 2407WFP and BenQ 2400v and Philips 150v3
Screen Resolution
3840x1200 and 1024x768
Hard Drives
2 WDC 1TB
1 WDC 1.5TB
1 WDC 640GB
1 WDC 320GB
1 Seagate 200GB
PSU
Corsair TX 850W
Case
Cooler Master HAF932
Cooling
Arctic Cooling Freezer Extreme and plenty of fans...
Keyboard
MicrosoftNaturalKeyboard 4000/Apple Alu keyboard/Dinovo mini
Mouse
Logitech G5/MarbleMouseTrackball/PerformanceMX/SpacePilotPRO
Internet Speed
1.5Mbps down/384Kbps up
Other Info
APC SURT 1000XL
Logitech Z-560
Wiimote
Mikrotik Router
Linksys (now Cisco) SD2008 8 port Gigabit switch
Linksys WRT54G (acting as AP)
Apple wireless Aluminium keyboard
Apple Magic Mouse
Xbox360 wired controller
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.:cool:
 

My Computer

Computer Manufacturer/Model Number
Dell e6410
OS
Windows 7 Pro
CPU
Intel Core i5 M520 @ 240GHz
Memory
2 Gig
Graphics Card(s)
Intel Grap
Sound Card
Intel Graphics Media Accelerator HD
Monitor(s) Displays
Built in (LapTop)
Screen Resolution
1440x900
Hard Drives
250 Gig STAT
Mouse
Logitech Bluetooth
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 Computer

OS
XP
Thanks for posting back, we'll be here.
 

My Computer

Computer Manufacturer/Model Number
* BFK Customs *
OS
W 7 64-bit Ultimate
CPU
Intel Q9550 Yorkfield
Motherboard
ASUS P5Q Pro
Memory
8GB Dominator 8500C5D
Graphics Card(s)
ATI : XFX 5870
Sound Card
Realtek HD Audio 7-1
Monitor(s) Displays
1x 47" LCD HDMI & 3x 26" LCD HDMI
Screen Resolution
1920x1080P & 1920x1200
Hard Drives
1x 80GB Intel X25-M G2 SSD : 1x 500GB & 1x 640GB WD Caviar Black(s)
PSU
Corsair 620HX
Case
Cooler Master RC-690
Cooling
Tuniq Tower 120, 2x 140mm and 3x 120mm case fans
Keyboard
Microsoft 500
Mouse
Razer Diamondback 3G
Internet Speed
14 Mb/s
Other Info
1x Koutech 3Gb/s SATA HDD Hot Swap Rack
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 Computer

Computer Manufacturer/Model Number
HomeBrew
OS
Win7/XP
CPU
INTEL E8600 @ 4.2GHz
Motherboard
Asus P5E w/Formula Rampage BIOS
Memory
8GB PC8500 Corsiar Dominator
Graphics Card(s)
nVidia GTX 280
Sound Card
Asus FXII (SoundMax controlled)
Monitor(s) Displays
2 x I-INC 28'
Screen Resolution
1920x1200
Hard Drives
2 x Seagate 1.5TB
PSU
Ultra 700W
Case
Something..with alot of air
Cooling
Tuniq 120 CPU - Several 80mm and one 120MM fan
Keyboard
IBM MODEL M - YA BABY!!! NEVER SAY DIE!
Mouse
MS Intellimouse
Internet Speed
50/5
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 Computer

Computer Manufacturer/Model Number
POS
OS
OS3.5
CPU
celery
Motherboard
Good Question ...Unknown
Memory
memory never forgets
Graphics Card(s)
OB
Sound Card
OB
Monitor(s) Displays
HUGE
Screen Resolution
168000000x105000000
Hard Drives
full
PSU
OEM 65watt
Case
N/A
Cooling
OB
Keyboard
OB
Mouse
mouse
Internet Speed
1 Trillion MBps
Other Info
Still An Awesome Forum!
I would think he is running it from pe, and using either as a fix, or as part of an automated instalation routine .
 

My Computers

System One System Two

  • Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
Dear All !
Today i tried to as you advised and It WORKED !!! Thank you so much once again

Reason : Some guys are wondering why I am doing that .... Actually I imaged the machine with Imagex and after deployment it complaints about the Boot Manager and from the Tech Net i got the above commands and then make a batch file so I not have to copy /past each command.
 

My Computer

OS
XP
Hello N A Malik.



Glad to see you found a solution, thanks for the update.
 

My Computer

Computer Manufacturer/Model Number
* BFK Customs *
OS
W 7 64-bit Ultimate
CPU
Intel Q9550 Yorkfield
Motherboard
ASUS P5Q Pro
Memory
8GB Dominator 8500C5D
Graphics Card(s)
ATI : XFX 5870
Sound Card
Realtek HD Audio 7-1
Monitor(s) Displays
1x 47" LCD HDMI & 3x 26" LCD HDMI
Screen Resolution
1920x1080P & 1920x1200
Hard Drives
1x 80GB Intel X25-M G2 SSD : 1x 500GB & 1x 640GB WD Caviar Black(s)
PSU
Corsair 620HX
Case
Cooler Master RC-690
Cooling
Tuniq Tower 120, 2x 140mm and 3x 120mm case fans
Keyboard
Microsoft 500
Mouse
Razer Diamondback 3G
Internet Speed
14 Mb/s
Other Info
1x Koutech 3Gb/s SATA HDD Hot Swap Rack
I used it because after imaging a machine with imagex it complaint about the boot mananger and not recognizizes the "C" partition as boot partition.
 

My Computer

OS
XP
Back
Top