Dennis identified one problem and provided a solution in his answer. But there are still other issues.
1) Your code set partial_name = %%G
will include a trailing space in the variable name and a leading space in the value. The code should read set partial_name=%%G
2) Your %1
value may already be quoted, in which case you should remove the quotes before adding your own by using "%~1"
instead of "%1"
.
3) Perhaps not a problem in your case, but it is generally a good idea to enclose file paths in quotes in case the name contains space or special characters.
4) I'm assuming you want to do a numeric comparison. The IF command uses almost the same rules as the SET /A command when it attempts to parse a number - Any number prefixed with 0 will be treated as hexadecimal notation. If it finds an invalid hex digit like 8 or 9, then the IF will revert to a string comparison instead of a numeric comparison.
For example if 09 lss 8 (echo true) else echo false
returns true
.
So if the 2nd segment of your file name has the potential to have leading zeros, then you need to do more work.
set "partial_name="
for /f "tokens=2 delims=." %%G in ("%~1") do (
for /f "tokens=* delims=0" %%N in ("%%G") do set /a "partial_name=%%N"
if not defined partial_name set "partial_name=0"
)
if %partial_name% GEQ 9200 (
move "I:\rosa\transfertmp\%1" "L:\OSLDos\Tmp\"
) else (
move "I:\rosa\transfertmp\%1" "L:\LdisOSLDos\Tmp\"
)