Joseph
Joseph

Reputation: 15

Batch set /a not working

I've looked alot and can't find why this is happening. It's very simple but doesn't work.

:numbers
cls
set /p first=First:
set /p second=Second:
set /p third=Third:
set /p fourth=Fourth:
set /p fifth=Fifth:
goto solve
:solve
cls
set /a s-f= %second% - %first%
set /a t-s= %third% - %second%

But the last two lines don't work and I know it's these because I have tried an echo %variable_name% and it shows up as what I want but the /a doesn't.

Upvotes: 1

Views: 273

Answers (1)

Magoo
Magoo

Reputation: 80211

s-f isnot a valid variable name. If you use s_f instead, that variable will be set appropriately.

Upvotes: 1

Related Questions