Need Help with Batch File

Page 1 of 2 12 LastLast

  1. Posts : 22
    XP
       #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 Computer


  2. Posts : 22,814
    W 7 64-bit Ultimate
       #2

    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


  3. Posts : 30
    Windows 7 Pro
       #3

    N A Malik said:
    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


  4. Posts : 1,325
    Windows7 Ultimate 64bit
       #4

    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


  5. Posts : 30
    Windows 7 Pro
       #5

    zzz2496 said:
    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 Computer


  6. Posts : 22
    XP
    Thread Starter
       #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 Computer


  7. Posts : 22,814
    W 7 64-bit Ultimate
       #7

    Thanks for posting back, we'll be here.
      My Computer


  8. Posts : 92
    Win7/XP
       #8

    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


  9. OEM
    Posts : 617
    OS3.5
       #9

    dood said:
    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


  10. Posts : 16,129
    7 X64
       #10

    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


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About 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 05:37.
Find Us