Hi 2
conejofe and welcome.
If you have no other files and folders in that folder with "File x.txt",
then you may try to use such batch:
- get last name (but the dir command may sort in other way than you see in the panel, especially with underscore or such, try it out)
- create directory with last found name
- delete all *.txt files in that folder
do.cmd
Code: Select all
@ECHO OFF
ECHO Working in
ECHO %CD%
ECHO.
PAUSE
for /f "delims=*" %%a in ('dir /b *.txt') DO @SET myFilename=%%~na
echo "%myFilename%"
MD "%myFilename%"
DEL *.txt
pause
That batch will run in current folder / working directory.
You can create also an button to call that batch just in current visible folder.