1.

Solve : batch file for checking extention of files in folder?

Answer»

I want to create a batch file which checks the extention of all FILES in folder(source) and move the files to particular files.
i.e if doc file is there it should be MOVED to doc folder. pdf to pdf folder and so on.

Please help me out.

Thanks in advanceCode: [SELECT]@echo off
setlocal enabledelayedexpansion
for %%a in (*.*) do (
SET "ext=%%~xa"
set ext=!ext:~1!
MD "!ext!" 2>nul
move "%%a" "!ext!"
)



Discussion

No Comment Found