List folders as a variable

March 17, 2010 at 11:06:44
Specs: XP
I want to be able to look at the user profile folder capture the name of the folders and store that in a variable.

Would anyone be able to help me with the code to do so?

I've got this so far

cd C:\Documents and Settings
dir /b /on

As you can see thats very little lol!


See More: List folders as a variable

Report •

#1
March 17, 2010 at 11:39:36
@echo off > newfile & setLocal enableDELAYedeXpansion
pushd "%USERPROFILE%"
for /f "tokens=* delims= " %%a in ('dir/b/ad') do (
set V=!V!%%a
)
echo.!V!


=====================================
Helping others achieve escape felicity

M2


Report •
Related Solutions


Ask Question