1.

Solve : Batch File help for Beginner?

Answer»

Hi All,

i'm very new to batch FILES and appologees if this is very simple question.

i currently have over 100 avi files located on P:\films\films\ and would LIKE create a .nfo file for each, KEEPING the same file name i.e Star Wars Episode II - Attack Of The Clones.avi with Star Wars Episode II - Attack Of The Clones.nfo

Can some please advise what the cmd would be to complete this function?

Thank you in advance. For this job you will need the FOR command.
Code: [Select]FOR /?For more info.

To create an empty file the command:
Code: [Select]ECHO.>(filename)will suffice.

So, perhaps:
Code: [Select]ECHO OFF
P:
CD P:\films\films
FOR %%I IN (*.avi) DO ECHO.>%%~nI.nfo
edit:
Although, would be faster to just open Run and ENTER this:
Code: [Select]FOR %I IN (P:\films\films\*.avi) DO ECHO.>%~nI.nfoThank you Veltas - worked a treat!!!



Discussion

No Comment Found