How to list files in a folder with input?
Moderator: DosItHelp
-
- Posts: 3
- Joined: 11 Sep 2012 15:09
How to list files in a folder with input?
I want to automatically display all files in a folder, but I need it to be with input so I can respond with a file name. Any ideas? Help would greatly be appreciated.
Re: How to list files in a folder with input?
Can you describe what you need to do more thoroughly?
This should display the files in the current directory.
dir /b /a:-d
This should display the files in the current directory.
dir /b /a:-d
-
- Posts: 3
- Joined: 11 Sep 2012 15:09
Re: How to list files in a folder with input?
What I'm trying to do, is make a user input in a batch file. It automatically lists...
I just figured it out in my head. Well, with help from your line too.
Thank you
I just figured it out in my head. Well, with help from your line too.
Thank you

-
- Posts: 3
- Joined: 11 Sep 2012 15:09
Re: How to list files in a folder with input?
foxidrive wrote:Can you describe what you need to do more thoroughly?
This should display the files in the current directory.
dir /b /a:-d
Actually, how would I modify this to list folders in a different folder rather than the current one?
Re: How to list files in a folder with input?
Actually, how would I modify this to list folders in a different folder rather than the current one?[/quote]
Did you want to list folders or files? This lists files.
Launch it like this: dirlist.bat "c:\folder\files\"
or dirlist.bat d:\backup
or drag a folder onto the icon.
Did you want to list folders or files? This lists files.
Code: Select all
@echo off
dir "%~1" /b /a:-d
pause
Launch it like this: dirlist.bat "c:\folder\files\"
or dirlist.bat d:\backup
or drag a folder onto the icon.