Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Although usually people install Windows in partition C,I think there'll be some problems if I just use C:\\ as the boot directory.I've googled this but did not find the key. So how can I get the boot partition in Batch?

share|improve this question
    
Strictly speaking, you're asking for the boot volume's drive letter, not the system volume's. The windows directory and the system directory (usually) live on the boot volume. – JdeBP Jul 20 '11 at 11:30
    
@JdeBP,Thanks for the correction. – SpawnST Jul 21 '11 at 0:19
up vote 5 down vote accepted

You can use the System Variable %SystemDrive% to change to the Windows Directory. Wikipedia has a good list of system variables.

share|improve this answer
    
The nice link is appreciated.Thanks. – SpawnST Jul 20 '11 at 8:35

Use the %SystemDrive% environment variable.

It will (for example) return C:, so remember to add the directory divider after it manually.

share|improve this answer
    
Thanks for the nice note. – SpawnST Jul 20 '11 at 8:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .