Page 1 of 1

how do i pass a variable that has @ in it?

Posted: 30 Dec 2022 09:54
by nnnmmm

Code: Select all

SET Y1=@OK games
SET M1=%~d0%\%Y1%\AVP 2 - v1091\!AVP 2 - V1091.BAT
SET M2=%~d0%\%%Y1%%\AVP 2 - v1091\!AVP 2 - V1091.BAT
SET M3=%~d0%\\%%Y1%%\AVP 2 - v1091\!AVP 2 - V1091.BAT
SET M4=%~d0%\\\%%Y1%%\AVP 2 - v1091\!AVP 2 - V1091.BAT
SET M5=%~d0%%Y1%%\AVP 2 - v1091\!AVP 2 - V1091.BAT

SET T1=%~d0%\@OK games\AVP 2 - v1091\!AVP 2 - V1091.BAT

ECHO "%M1%"
ECHO "%M2%"
ECHO "%M3%"
ECHO "%M4%"
ECHO "%M5%"

ECHO "%T1%"

PAUSE
GOTO :EOF
M1 M2 M3 M4 M5 dont work
only doing it like T1 works
how do i pass a variable that has @ in it?
the reason why i use ! and @ for a dir or a file name is they are the 1st ones to show in the line

Re: how do i pass a variable that has @ in it?

Posted: 30 Dec 2022 11:09
by Lucky4Me
Remove the % at the end of %~d0%
like this

SET M1=%~d0\%Y1%\AVP 2 - v1091\!AVP 2 - V1091.BAT
SET M2=%~d0\%Y1%\AVP 2 - v1091\!AVP 2 - V1091.BAT
SET M3=%~d0\%Y1%\AVP 2 - v1091\!AVP 2 - V1091.BAT
SET M4=%~d0\%Y1%\AVP 2 - v1091\!AVP 2 - V1091.BAT
SET M5=%~d0\%Y1%\AVP 2 - v1091\!AVP 2 - V1091.BAT

Re: how do i pass a variable that has @ in it?

Posted: 31 Dec 2022 23:20
by nnnmmm
thanks for the help

a half of my batch files uses %~d0% and the other half %~d0, then time went by decades.
i will try to replace %~d0% with %~d0 if i can, from 100's batches for 1000's implications.