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

Author Topic: Copy the names of root folder, sub folders and the files with in  (Read 8138 times)

0 Members and 1 Guest are viewing this topic.

suneelkuppili

    Topic Starter


    Rookie

    Hello All

    I want to get a list of all names of main folders, subfolders and the files with in the subfolders in a particular directory/root folder.

    I want to run a DOS command. Please help

    Suneel

    Carbon Dudeoxide

    • Global Moderator

    • Mastermind
    • Thanked: 169
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Experience: Guru
    • OS: Mac OS
    Re: Copy the names of root folder, sub folders and the files with in
    « Reply #1 on: June 05, 2008, 06:01:09 AM »
    Try
    Code: [Select]
    Dir C:\path\ /s

    suneelkuppili

      Topic Starter


      Rookie

      Re: Copy the names of root folder, sub folders and the files with in
      « Reply #2 on: June 05, 2008, 06:07:45 AM »
      Thanks, can you please complete path.
      Suppose, If I am in C drive and i want it to create a text file called sample.txt

      Thanks in advance

      Carbon Dudeoxide

      • Global Moderator

      • Mastermind
      • Thanked: 169
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Experience: Guru
      • OS: Mac OS
      Re: Copy the names of root folder, sub folders and the files with in
      « Reply #3 on: June 05, 2008, 06:12:08 AM »
      I wonder why  ::) ::)

      To save dos results to a text file, you just have to use '>>'s

      Example:

      Code: [Select]
      dir C:\path\ /s >>"C:\sample.txt"

      suneelkuppili

        Topic Starter


        Rookie

        Re: Copy the names of root folder, sub folders and the files with in
        « Reply #4 on: June 05, 2008, 06:25:57 AM »
        I am getting the message that "Access is denied"

        Carbon Dudeoxide

        • Global Moderator

        • Mastermind
        • Thanked: 169
          • Yes
          • Yes
          • Yes
        • Certifications: List
        • Experience: Guru
        • OS: Mac OS
        Re: Copy the names of root folder, sub folders and the files with in
        « Reply #5 on: June 05, 2008, 06:27:27 AM »
        Access is denied?

        What OS is this?

        suneelkuppili

          Topic Starter


          Rookie

          Re: Copy the names of root folder, sub folders and the files with in
          « Reply #6 on: June 05, 2008, 06:29:36 AM »
          MS DOS in MS Vista  :o

          Carbon Dudeoxide

          • Global Moderator

          • Mastermind
          • Thanked: 169
            • Yes
            • Yes
            • Yes
          • Certifications: List
          • Experience: Guru
          • OS: Mac OS
          Re: Copy the names of root folder, sub folders and the files with in
          « Reply #7 on: June 05, 2008, 06:30:19 AM »
          Wait a sec, try this code:

          Code: [Select]
          dir C:\path /s >>"C:\sample.txt"

          .bat_man

          • Guest
          Re: Copy the names of root folder, sub folders and the files with in
          « Reply #8 on: June 05, 2008, 06:31:59 AM »
          are u sure u have permitions on the PC u work on
          couse the right command is what Carbon Dudeoxide said

          suneelkuppili

            Topic Starter


            Rookie

            Re: Copy the names of root folder, sub folders and the files with in
            « Reply #9 on: June 05, 2008, 06:33:58 AM »
            Same "Access is denied"

            Carbon Dudeoxide

            • Global Moderator

            • Mastermind
            • Thanked: 169
              • Yes
              • Yes
              • Yes
            • Certifications: List
            • Experience: Guru
            • OS: Mac OS
            Re: Copy the names of root folder, sub folders and the files with in
            « Reply #10 on: June 05, 2008, 06:33:58 AM »
            are u sure u have permitions on the PC u work on
            couse the right command is what Carbon Dudeoxide said

            It didn't work for me when I tried it. There was an extra '\'

            suneelkuppili

              Topic Starter


              Rookie

              Re: Copy the names of root folder, sub folders and the files with in
              « Reply #11 on: June 05, 2008, 06:36:58 AM »
              I have admin privileges[at work place], but still I am not able to

              Carbon Dudeoxide

              • Global Moderator

              • Mastermind
              • Thanked: 169
                • Yes
                • Yes
                • Yes
              • Certifications: List
              • Experience: Guru
              • OS: Mac OS
              Re: Copy the names of root folder, sub folders and the files with in
              « Reply #12 on: June 05, 2008, 06:37:42 AM »
              Oh how stupid of me. I dir my C drive every fortnight and I still can't get it right...

              Try this:

              Code: [Select]
              dir "C:\path" /s >>"C:\sample.txt"

              .bat_man

              • Guest
              Re: Copy the names of root folder, sub folders and the files with in
              « Reply #13 on: June 05, 2008, 06:39:05 AM »
              i dont have path directory for that i chope it out from the path so i tryed

              dir c:\ /s

              and that what work for me
              so i didnt mean to give wrong info

              Carbon Dudeoxide

              • Global Moderator

              • Mastermind
              • Thanked: 169
                • Yes
                • Yes
                • Yes
              • Certifications: List
              • Experience: Guru
              • OS: Mac OS
              Re: Copy the names of root folder, sub folders and the files with in
              « Reply #14 on: June 05, 2008, 06:40:05 AM »
              the C:\path was an example where you change 'path' to where you want to Dir.

              .bat_man

              • Guest
              Re: Copy the names of root folder, sub folders and the files with in
              « Reply #15 on: June 05, 2008, 06:41:06 AM »
              there is nothing with the comand  i think its somthing related to the OS he is using or some security issues

              Carbon Dudeoxide

              • Global Moderator

              • Mastermind
              • Thanked: 169
                • Yes
                • Yes
                • Yes
              • Certifications: List
              • Experience: Guru
              • OS: Mac OS
              Re: Copy the names of root folder, sub folders and the files with in
              « Reply #16 on: June 05, 2008, 06:42:38 AM »
              'Path' is just the example.

              I would post 'C:\path' and he would change it to (for example) 'C:\documents and settings' or something.

               :D

              suneelkuppili

                Topic Starter


                Rookie

                Re: Copy the names of root folder, sub folders and the files with in
                « Reply #17 on: June 05, 2008, 06:43:28 AM »
                it says "file not found" but I saw the contents of the file

                " Volume in drive E is DATA
                 Volume Serial Number is ACA9-FF62"

                .bat_man

                • Guest
                Re: Copy the names of root folder, sub folders and the files with in
                « Reply #18 on: June 05, 2008, 06:46:12 AM »
                make sure that the file may be heddin for that u have to do
                dir c:\path /a /s

                suneelkuppili

                  Topic Starter


                  Rookie

                  Re: Copy the names of root folder, sub folders and the files with in
                  « Reply #19 on: June 05, 2008, 06:49:39 AM »
                  Anyways, I am not getting....thanks for your help

                  Carbon Dudeoxide

                  • Global Moderator

                  • Mastermind
                  • Thanked: 169
                    • Yes
                    • Yes
                    • Yes
                  • Certifications: List
                  • Experience: Guru
                  • OS: Mac OS
                  Re: Copy the names of root folder, sub folders and the files with in
                  « Reply #20 on: June 05, 2008, 06:51:16 AM »
                  When I plug in my flash drive (E:\), it works fine.

                  dir E:\ /s>>"C:\file.txt"

                  It is possible the code is right but the flash drive isn't allowing this.

                  .bat_man

                  • Guest
                  Re: Copy the names of root folder, sub folders and the files with in
                  « Reply #21 on: June 05, 2008, 06:51:33 AM »
                  can u try to make the same command on an other path

                  suneelkuppili

                    Topic Starter


                    Rookie

                    Re: Copy the names of root folder, sub folders and the files with in
                    « Reply #22 on: June 05, 2008, 06:52:41 AM »
                    tried in c and e drives as well

                    Carbon Dudeoxide

                    • Global Moderator

                    • Mastermind
                    • Thanked: 169
                      • Yes
                      • Yes
                      • Yes
                    • Certifications: List
                    • Experience: Guru
                    • OS: Mac OS
                    Re: Copy the names of root folder, sub folders and the files with in
                    « Reply #23 on: June 05, 2008, 06:54:19 AM »
                    First of all, does the dir E:\ /s work at all? Is the problem saving the file?

                    Quote
                    " Volume in drive E is DATA
                     Volume Serial Number is ACA9-FF62"
                    BTW, this is normal, I have this too.

                    suneelkuppili

                      Topic Starter


                      Rookie

                      Re: Copy the names of root folder, sub folders and the files with in
                      « Reply #24 on: June 05, 2008, 06:58:28 AM »
                      I think so, not able to troubleshoot...
                      see u tomorrow