Page 1 of 1

Q on Set command format

Posted: 30 Aug 2009 08:57
by Jc_oz
Hi, just a quick question.

I have a script which I am using the set statement.

alpha is a variable that has been previously set but for some reason the following does not work.

Code: Select all

&&set "alpha=%fname:~-1!%"

All I want is the the last digit of "fname" (also a variable set earlier) to be assigned to "alpha"

I can't understand why it does not work....

Thanks for any suggestions

Regards,

John

Posted: 30 Aug 2009 19:55
by DccD
I'm not sure why you put the excalamation (!) but this should work:

Code: Select all

set "alpha=%fname:~-1%"