My mistake, sort of. It isn't %username%, it's %userprofile%., which is
usually
"C:\Documents and Settings\[username]\"
But even that doesn't work with the DIR command.
cd %userprofile% works
dir %userprofile% does not work
dir [folder] > %userprofile%\desktop\[filename] does not work.
Whether any of this is also true in Vista I don't know.
--
Gary S. Terhune
MS-MVP Shell/User
www.grystmill.com
"Gary S. Terhune" <none> wrote in message
Where you use %username% it should be %userprofile%
Maybe that's different in Vista, but it would surprise me.
--
Gary S. Terhune
MS-MVP Shell/User
www.grystmill.com
I never could get the command to put the file on the desktop. It does
work great putting the text file on C drive.
This is very nice little command to have.
"And to add to that, it's not just "similar." That command in XP is
exactly the same command that's used in Vista."
I am not exactly sure that is correct statement as the command used
in Vista is like this:
dir /s "H:\Vista Software II" >
%userprofile%\desktop\vistasoftware.txt
where H:\Vista Software II is the folder that files will be listed
for and
vistasoftware.txt is the name of the text file generated on the desk
top
Yes, it's exactly the same. The command you cite above is just one way
to do it. It doesn't have to be %userprofile%\desktop\ and you don't
even have to put it on the desktop. My personal preference is not to
put anything on the desktop except shortcuts that I want to
keep.
And the /s can be in either position.
--
Ken Blake - Microsoft MVP Windows: Shell/User
Please reply to the newsgroup
[Jerry] wrote-:
I have two computers, one has Vista Ultimate and the other has Win
XP Pro.
Recently I learned that in Vista a text file can be generated from
the
Command Prompt that will list All Subfolders and Files within a
Folder. I
was wondering if there is something similar that works in Win XP
Pro.
This would be a nice thing to have. Thank you.
Open Command Prompt and run:
DIR "C:\Windows" /s > "C:\List.txt"
And to add to that, it's not just "similar." That command in XP is
exactly the same command that's used in Vista.