i want to write a batch file that creates a dir.tmp and processes that to make a directory of the same name LESS the .TBN extension, so it needs to rtrim te string and parse back to %G. Otherwise it will try and create a dir with the same name as the file and crash! you can see the commented out attempt to concatenate.
@cls
SET MyVar=.TBN
@ECHO OFF
COLOR 70
ECHO ------------------------------
ECHO XBMC TBN TO DIR Creator V0.99
ECHO ------------------------------
ECHO be sure you have run a seperate
echo export first, you will need to
echo run a database rebuild next....
pause
COLOR
@echo off
DIR /B *.TBN >DIR.TMP
FOR /F %%G IN (DIR.TMP) DO MD %%G
:Call :TRIM %%MyVar%%
:Echo MyVar=[%%MyVar%%]
:Set MyVar =
:echo %%G
:GoTo :EOF
:TRIM
:Set MyVar=%%*
:GoTo :EOF
MD %%G
:move /Y %%G.* ..%%G