0

I have the file named: italo.jpeg

How to extract italo (before period) using:

set file=italo.jpeg
set prefix=%file:~[arguments]%

I've tried %file:~0,"."% but didn't work...

1 Answers1

0
for /f "delims=." %%b in ("%file%") do set "prefix=%%b"

or, since this is a filename,

for %%b in ("%file%") do set "prefix=%%~nb"

Documentation : enter for /? at the prompt.

Magoo
  • 77,302
  • 8
  • 62
  • 84