Hi,
this Macro is for AutoCAD LT Version. Autocad doesn't have setenv/getenv command, it can't work.
In AutoCAD (and also in LT since version 2024) you can use Lisp to do the same.
^C^C(if (eq (getenv 'Background) "0") (setenv "Background" "16777215") (setenv "Background" "0"));_TILEMODE;0;_TILEMODE;1;
Or a lispfunktion like that
https://cadpanacea.com/wp/?p=242