This is my code:
code:
@echo off
FOR /f "tokens=*" %%G IN ('dir /b') DO (
[my actions, no problem here]
)
It does my actions for each file in the bat file's folder.
The problem is, one of the arguments I need is the file's name without the extension. For example:
%%G is
"My text file.txt" and I need to use the command
-set name="My text file" .
So I changed
-set name="%%G" to
-set name="%%G:~0,-4%", which should ignore the last 4 characters (dot + extension), but it doesn't work.
Does anyone know how to solve this?