On 15/05/2012 9:45 AM, Auric__ wrote:
>
> Try this:
What is delayed expansion enabled when you aren't using it? :)
It could all be done in a loop with delayedexpansion
> setlocal enabledelayedexpansion
> for %%a in (*.txt) do (
> set FNAME=%%a
> call :Loop
> )
> :Loop
> set FPART=%FNAME:~0,4%
> if not exist %FPART%\nul mkdir %FPART%
the \nul trick is deprecated now.
For a folder this is reliable in NT windows: if exist "d:\folder\"
> copy "%FNAME%" %FPART%
> goto :EOF
>
> If it works the way you want it to, change "copy" to "move".
>
--
Mic