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

Author Topic: List Directories in other user profiles  (Read 2113 times)

0 Members and 1 Guest are viewing this topic.

wickedchew

    Topic Starter


    Rookie
    List Directories in other user profiles
    « on: October 01, 2006, 04:55:18 AM »
    Hello again!

    I'm trying to create a batch file that would list the directories in other user profiles such as the one that is logged in... but it's driving me nuts!

    I only have:

    dir C:\Documents and Settings\All Users\ >> list.txt
    dir C:\Documents and Settings\Administrator\ >> list.txt
    dir C:\Documents and Settings\Guest\ >> list.txt
    dir C:\Documents and Settings\Default User\ >> list.txt
    dir C:\Documents and Settings\LocalService\ >> list.txt
    dir C:\Documents and Settings\NetworkService\ >> list.txt
    dir "%userprofile%"\ >> list.txt
    dir C:\Documents and Settings\(other user profile)\ >> list.txt

    If the dir list could be shortend, it would be appreciated. I'm still learning all the batch file tricks.

     ;D ECHO  ;D
    "If it's there and you can see it — it's real.

    wickedchew

      Topic Starter


      Rookie
      Re: List Directories in other user profiles
      « Reply #1 on: November 09, 2006, 08:34:40 PM »
      I got this one cracked too!

      -------------------------------
      @echo off
      cls

      cd "%systemdrive%\Documents and Settings\"
      for /d %%a in (*) do dir "%%a\*" >>list.txt

      -------------------------------

      ECHO
      "If it's there and you can see it — it's real.

      QBasicMac

      • Guest
      Re: List Directories in other user profiles
      « Reply #2 on: November 09, 2006, 08:43:35 PM »
      If you actually use that in real life, you will note that list.txt gets bigger and bigger.

      You want something like
      echo. >list.txt
      at the start of you BAT file

      Mac