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?

link|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
feedback

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.

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

Use the %SystemDrive% environment variable.

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

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

Your Answer

 
or
required, but never shown

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