1.

Solve : Ms Dos command to know in which drive the operating system is installed?

Answer»

Hi everybody, I am chaitanya. I need some help regarding the operating system installation path. There is no rule that the operating system must be installed in 'c' drive only. So I need a command to know in which drive the operating system is installed.
Thank you all in advance.Your title says "MS-DOS command". Well, MS-DOS is always installed on drive C. if, however, you meant a Microsoft Windows console command, then for Windows NT family OSs the system variable %SystemDrive% contains the letter of the drive on which the currently running operating system is installed. It MAY be the same on W95/98/ME.

Type SET at the prompt to see all current system variables.
Thank you Salmon for your quick reply, but this doesn't solve my problem. I want to know the drive of the current operating system. I am preparing a batch file to automate a process in my project. As a part of the project I have to place some files in particular directories daily, and those directories are in the operating system. Some people can have their operating system installed in d drive also. So I need a command to get that one.

Hope this explains you my problem. Please help me with this. Thank you in advance.You asked how to find which "drive" the operating system is installed on. A Windows system can have up to 26 drive letters. I just told you that the environment variable %SystemDrive% contains the drive letter (and its following colon) of the current operating system. What part of that did you not understand?


Thank you Salmon for helping meQuote from: krishnaanu on December 11, 2009, 04:08:39 AM

Sir %SystemDrive% is not working. My operating system is Windows XP Service Pack 3

So is mine. How are you using %systemdrive% ? Do you know what a variable is ? And how to use one in a batch script?
Sorry sir, I am new to batch scripting, there is some confusion. Any how thank you a lot for your interest in solving my problem.Quote from: krishnaanu on December 11, 2009, 04:13:59 AM
Sorry sir, I am new to batch scripting, there is some confusion. Any how thank you a lot for your interest in solving my problem.

echo %SystemDrive%

START>RUN> [type] CMD

U VIL knoe at the dos windowHow does that answer the question?
It is real easy people. On any version of Windows, open the command prompt (or DOS prompt for you legacy users) and type "VER". Quote from: saboya on December 13, 2009, 06:37:59 AM
It is real easy people. On any version of Windows, open the command prompt (or DOS prompt for you legacy users) and type "VER".




Discussion

No Comment Found