79334386

Date: 2025-01-06 21:33:03
Score: 1
Natty:
Report link

Does this solve your problem?

@ECHO OFF
SETLOCAL
set "var1=Hello world"
Echo var1 before: %var1%
call:myDosFunc var1 
Echo var1 after : %var1%
goto :eof

:myDosFunc    -- passing a variable by reference, and changing value
echo   Notice that a variable passed by reference does NOT echo the value, and it echos the variable name instead.

CALL SET "arg2=%%%~1%%"
echo %arg2%
echo   Arg1 variable name = '%~1' and Arg2 value = '%~2'
set "%~1=Good bye world!!!"
goto :eof
Reasons:
  • RegEx Blacklisted phrase (1.5): solve your problem?
  • Has code block (-0.5):
  • Ends in question mark (2):
  • High reputation (-2):
Posted by: Magoo