for /F %%k in ('dir /b*.cgm') do set FILENAME=%%~nk.cgm
what are, and where can i find a description of:-
1. /F : process each line in the file (or command output)
2. /b : only output filename in dir command
3. k : a loop variable
4. ~n : note the squiggle, means get just the name part of the filename held in variable k
Does this help?
Graham