List of Files and Folders

J

Jerry

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.
 
A

Ayush

[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"

Good Luck, Ayush.
 
K

Ken Blake, MVP

[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.
 
J

Jerry

"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


Ken Blake said:
[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.
 
G

Gary S. Terhune

That is the same command, just with different parameters. You simply
specified that it go to the Desktop, whereas Ayush specified that it go to
the C:\root.

The command is:

DIR [folder] /s > [text file]

DIR /s [folder] > [text file] is the same command with the /s switch in a
different place. Makes no difference. The /s switch can be anywhere in the
command, even at the end. However, [folder] must come before [text file]

--
Gary S. Terhune
MS-MVP Shell/User
www.grystmill.com

Jerry said:
"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


Ken Blake said:
[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.
 
K

Ken Blake

"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
Ken Blake said:
[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.
 
J

Jerry

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.

Ken Blake said:
"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
Ken Blake said:
[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.
 
G

Gary S. Terhune

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

Jerry said:
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.

Ken Blake said:
"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.
 
G

Gary S. Terhune

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 said:
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

Jerry said:
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.

Ken Blake said:
"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.
 
J

Jerry

Now I am confused <not unusual>"
I used this command to put the text file on C drive: H:\Vista Software II"
/s > "C:\List.txt
How do I change that to get the text file to go on the desktop?

Gary S. Terhune said:
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 said:
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

Jerry said:
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.
 
J

John John

dir >"%userprofile%\desktop\List.txt"

Note the quotation marks.

John
Now I am confused <not unusual>"
I used this command to put the text file on C drive: H:\Vista Software II"
/s > "C:\List.txt
How do I change that to get the text file to go on the desktop?

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

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.
 
G

Gary S. Terhune

In my experiments, the %userprofile% environmental doesn't work with the DIR
command.

--
Gary S. Terhune
MS-MVP Shell/User
www.grystmill.com

John John said:
dir >"%userprofile%\desktop\List.txt"

Note the quotation marks.

John
Now I am confused <not unusual>"
I used this command to put the text file on C drive: H:\Vista Software
II" /s > "C:\List.txt
How do I change that to get the text file to go on the desktop?

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.
 
G

Gary S. Terhune

dir /s "H:\Vista Software II" "C:\Documents and Settings\[your user name]\Desktop\List.txt"

--
Gary S. Terhune
MS-MVP Shell/User
www.grystmill.com

Jerry said:
Now I am confused <not unusual>"
I used this command to put the text file on C drive: H:\Vista Software II"
/s > "C:\List.txt
How do I change that to get the text file to go on the desktop?

Gary S. Terhune said:
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 said:
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.
 
J

Jerry

Sorry Gary, but that does nothing that I can tell.

"Gary S. Terhune" <none> wrote in message
dir /s "H:\Vista Software II" "C:\Documents and Settings\[your user
name]\Desktop\List.txt"

--
Gary S. Terhune
MS-MVP Shell/User
www.grystmill.com

Jerry said:
Now I am confused <not unusual>"
I used this command to put the text file on C drive: H:\Vista Software II"
/s > "C:\List.txt
How do I change that to get the text file to go on the desktop?

Gary S. Terhune said:
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 said:
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.
 
J

John John

Works fine here with XP Pro. If there are spaces in the user name you
have to use quotation marks.

John
 
G

Gary S. Terhune

You're right. Any command that uses %userprofile% has to be in quotes.
C:\Documents and Settings contains spaces.
 
G

Gary S. Terhune

You must get *some* return. What is it?

--
Gary S. Terhune
MS-MVP Shell/User
www.grystmill.com

Jerry said:
Sorry Gary, but that does nothing that I can tell.

"Gary S. Terhune" <none> wrote in message
dir /s "H:\Vista Software II" "C:\Documents and Settings\[your user
name]\Desktop\List.txt"

--
Gary S. Terhune
MS-MVP Shell/User
www.grystmill.com

Jerry said:
Now I am confused <not unusual>"
I used this command to put the text file on C drive: H:\Vista Software
II"
/s > "C:\List.txt
How do I change that to get the text file to go on the desktop?

Gary S. Terhune said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top