I find myself using:
dir /w /b >>c:\lister.txt
all too frequently for lists of all kinds.
1. I tried entering into the button bar with "dir" as the command and it keeps telling me "File Not Found." What am I doing wrong?
OR
Does TC do this already and I am not aware of it (or something close to it)?
Adding a command to the Button Bar
Moderators: Hacker, petermad, Stefan2, white
Thanks for bringing this up .. I have pipelined many times dir-content to a txt-file, and it's nice to know the conventions to make a button for it.
Some things remain though. This button would produce every time a file named 'lister.txt'. So, unless you take precautions, the previous 'lister.txt' will be overwritten.
Another option could be : using the format of a batch-file. A batch usually is filled with a sequence of commands, but it functions too with a one-liner.
Since a batch-file (.bat) is considered as being an executable, it's more easy to connect a button to it.
If the batch-file is located in one of the system-paths, then it can be called from any directory.
The problem of overwriting the previous output is not yet solved with this.
But a batch-file knows at least 9 variables, with a '%' prefix. These variables can be declared after the command.
Example : "listdir.bat" (ascii-format) contains the line :
dir /w /b >>c:\%1.txt
If you want such a file of the directory "photo", enter that place. You could then give the command :
listdir photo
and the file "photo.txt" is written.
How this could be implemented in a button, I don't know.
Some things remain though. This button would produce every time a file named 'lister.txt'. So, unless you take precautions, the previous 'lister.txt' will be overwritten.
Another option could be : using the format of a batch-file. A batch usually is filled with a sequence of commands, but it functions too with a one-liner.
Since a batch-file (.bat) is considered as being an executable, it's more easy to connect a button to it.
If the batch-file is located in one of the system-paths, then it can be called from any directory.
The problem of overwriting the previous output is not yet solved with this.
But a batch-file knows at least 9 variables, with a '%' prefix. These variables can be declared after the command.
Example : "listdir.bat" (ascii-format) contains the line :
dir /w /b >>c:\%1.txt
If you want such a file of the directory "photo", enter that place. You could then give the command :
listdir photo
and the file "photo.txt" is written.
How this could be implemented in a button, I don't know.
0.618033988
Why should it be overwritten? >> means attach.This button would produce every time a file named 'lister.txt'. So, unless you take precautions, the previous 'lister.txt' will be overwritten.
listdir photo
and the file "photo.txt" is written.
How this could be implemented in a button, I don't know.
Code: Select all
command: cmd.exe /c /v:on
parameter: set /p filename=Enter the target filename (.txt will be added automatically):&&dir /w /b>"!temp!\!filename!.txt"&¬epad.exe "!temp!\!filename!.txt"
This account is for sale
I use another variant:
This will prompt for the filename with "filelist.txt" as default.
Code: Select all
Command:
%comspec% /c dir /b >
Parameter:
?filelist.txt