Hi All
E:\MyProgramme contains number of files with different extensions. I want to show only all files with .exe , Please note that display file name only. Not display extension(i.e. .exe ). Please advice me how to write bat file for above requirement. I tried following one but display files with file extension.
DIR /B "E:\MyProgramme\*.exe" /O:d
Thank you
show files without extension
Moderator: DosItHelp
-
- Posts: 44
- Joined: 01 Jan 2011 20:54
Re: show files without extension
1)open the command prompt
2)type "H:" then hit enter
3)type "cd (folder name)" then hit enter
4)type "dir /b "*.exe""
2)type "H:" then hit enter
3)type "cd (folder name)" then hit enter
4)type "dir /b "*.exe""
Re: show files without extension
Process the DIR command in a FOR loop and use the ~n option to display only the file name.
Regards
aGerman
Code: Select all
for /f "delims=" %%a in ('dir /a-d /b ""E:\MyProgramme\*.exe"') do echo %%~na
Regards
aGerman
Re: show files without extension
hi aGerman
It works. thank you.
for /f "delims=" %%a in ('dir /a-d /b "E:\MyProgramme\*.exe"') do echo %%~na
It works. thank you.
for /f "delims=" %%a in ('dir /a-d /b "E:\MyProgramme\*.exe"') do echo %%~na