1.

Solve : List Directories in other user profiles?

Answer»

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.

ECHO I got this one cracked too!

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

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

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

ECHOIf 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



Discussion

No Comment Found