Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Ms Dos command to know in which drive the operating system is installed  (Read 4478 times)

0 Members and 1 Guest are viewing this topic.

krishnaanu

    Topic Starter


    Greenhorn

    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.

    Salmon Trout

    • Guest
    Re: Ms Dos command to know in which drive the operating system is installed
    « Reply #1 on: December 11, 2009, 03:38:35 AM »
    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.
    « Last Edit: December 11, 2009, 03:49:54 AM by Salmon Trout »

    krishnaanu

      Topic Starter


      Greenhorn

      Re: Ms Dos command to know in which drive the operating system is installed
      « Reply #2 on: December 11, 2009, 04:01:32 AM »
      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.

      Salmon Trout

      • Guest
      Re: Ms Dos command to know in which drive the operating system is installed
      « Reply #3 on: December 11, 2009, 04:06:24 AM »
      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?



      krishnaanu

        Topic Starter


        Greenhorn

        Re: Ms Dos command to know in which drive the operating system is installed
        « Reply #4 on: December 11, 2009, 04:08:39 AM »
        Thank you Salmon for helping me

        Salmon Trout

        • Guest
        Re: Ms Dos command to know in which drive the operating system is installed
        « Reply #5 on: December 11, 2009, 04:10:25 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?

        krishnaanu

          Topic Starter


          Greenhorn

          Re: Ms Dos command to know in which drive the operating system is installed
          « Reply #6 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.

          Salmon Trout

          • Guest
          Re: Ms Dos command to know in which drive the operating system is installed
          « Reply #7 on: December 11, 2009, 04:15:39 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%


          The_Game_Bane



            Rookie

            Re: Ms Dos command to know in which drive the operating system is installed
            « Reply #8 on: December 11, 2009, 09:18:38 AM »
            START>RUN> [type] CMD

            u vil knoe at the dos window

            Salmon Trout

            • Guest
            Re: Ms Dos command to know in which drive the operating system is installed
            « Reply #9 on: December 11, 2009, 09:44:28 AM »
            How does that answer the question?

            saboya

            • Guest
            Re: Ms Dos command to know in which drive the operating system is installed
            « Reply #10 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".

            Salmon Trout

            • Guest
            Re: Ms Dos command to know in which drive the operating system is installed
            « Reply #11 on: December 13, 2009, 07:02:30 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".


             ::)