Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.