1.

Solve : Is this .bat file correct??

Answer»

I'm trying to create a .bat file that does this:

for any file that arrives into C:/Input the bat file creates a subfolder in C:/Folders that has the NAME of that file, like this:

File XYZ.txt arrives into C:/Input and the bat file creates a subfolder in C:/Folders/ so it APPEARS as C:/Folders/XYZ.txt/

and then COPIES xyz.txt file fron C:/Input into C:/Folders/XYZ.txt/ so it appears like this: C:/Folders/XYZ.txt/xyz.txt

SOMEONE provided this, I ran it unsuccessfully. What am I MISSING? Thanks.

@echo off
set input=c:\input
set folders=c:\folders
for /F "delims=. tokens=1" %%i in ('dir %input%\*.* /A-D /B') Do (
md %input%\%%i
md %folders%\%%i
move %input%\%%i.* %folders%\%%i



Discussion

No Comment Found