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 8140 times)

0 Members and 2 Guests 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.