This lists all the files (and only the files) in the current directory:
for /r %i in (*) do echo %i
Also if you run that command in a batch file you need to double the % signs.
for /r %%i in (*) do echo %%i
(thanks @agnul)
More Related Contents:
- At which point does `for` or `for /R` enumerate the directory (tree)?
- How to correct variable overwriting misbehavior when parsing output?
- Batch script with for loop and pipe
- Batch file: Find if substring is in string (not in a file)
- How to do something to each file in a directory with a batch script
- How to delete files/subfolders in a specific directory at the command prompt in Windows
- How do I escape ampersands in batch files?
- Using a custom Tee command for .bat file
- Batch script: how to check for admin rights
- Setting a system environment variable from a Windows batch file?
- FORFILES date -after- (date calc in cmd file)
- Create an empty file on the commandline in windows (like the linux touch command)
- What is the proper way to test if a parameter is empty in a batch file?
- Using another language (code page) in a batch file made for others
- How can I debug a .BAT script?
- Creating a file name as a timestamp in a batch job
- Start multiple tasks in parallel and wait for them in windows?
- How do I create a shortcut via command-line in Windows?
- Why does findstr not handle case properly (in some circumstances)?
- How to pass environment variables as parameters by reference to another batch file?
- While loop in batch
- Execute multiple batch files concurrently and monitor if their process is completed
- Windows shell command to get the full path to the current directory?
- How to read input from console in a batch file?
- Batch goto loses errorlevel
- I need to match or replace an asterisk * in a batch environmental variable using only native Windows commands. Is this possible?
- Escape percent signs in given variables
- Out of a git console: how do I execute a batch file and then return to git console?
- UTF-16 to UTF-8 conversion (for scripting in Windows)
- How to expand a CMD shell variable twice (recursively)