Question Locked

copying text to a DOS command line

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am using a DOS command to create and run a one-line batch file (listing files on a drive). I am typing the command line anew for each directory, and there are many. They are all the same except for the name of the list created. Can I somehow copy text to a command line so that I don't have to retype the same line over and over? Also, is there a way to create a list of files on a drive using Windows and avoiding DOS altogether?

9 replies

by ernesto.valenzuela

High light what you are going to copy
Type Ctr c
Then go to the dos shell
Click on the small C:\ on the top left corner
Move down to edit
paste.

by toivo talikka

Thanks for the tip. Even though I use the command prompt a lot, I must admit I had never seen the small C:\ there...

by lllawson9

Thanks to all for your help.

Ernesto, your reply was just what I needed. I really appreciate it.

by tonythetiger

if you type dir c:\dir1 [enter]

then press F2 and "1", it will fill in up to

dir c:\dir

and you can just put a '2' on the end

Or use your up arrow to repeat previous commands and change the part you want different.

by 1bn0

Tree prints a graphical view of the file structure.
i.e.

P:\sample>tree
Folder PATH listing
Volume serial number is 00002EBC AC24:FD25
P:.
├───Folder 1
├───Folder 2
└───Folder 3

Tree /F prints the tree and the files in each directory.

P:\sample>tree /f
Folder PATH listing
Volume serial number is 0000093A AC24:FD25
P:.
│ Copy (1) of filename1.txt
│ Copy (2) of filename1.txt
│ Copy (3) of filename1.txt
│ Copy (4) of filename1.txt
│
├───Folder 1
│ Copy (1) of filename1.txt
│ Copy (2) of filename1.txt
│ Copy (3) of filename1.txt
│ Copy (4) of filename1.txt
│
├───Folder 2
│ Copy (1) of filename1.txt
│ Copy (2) of filename1.txt
│ Copy (3) of filename1.txt
│ Copy (4) of filename1.txt
│
└───Folder 3
Copy (1) of filename1.txt
Copy (2) of filename1.txt
Copy (3) of filename1.txt
Copy (4) of filename1.txt

Not sure if this output will suit your purposes or not.

by faradhi

dir [drive]:\ /s

That will list all the files. If you want no header information, add /b.

This way you do not have to copy you can just run once per drive instead of each directory.

This discussion is closed to new replies.