Page 1 of 1

batch system variable that stays through different sessions

Posted: 03 Nov 2011 00:55
by Rileyh
Hi,
I want to make a variable that is made from a batch file. This variable is will carry through as a built-in variable and will always be there even if you exit and start cmd again. It also needs to be there in a batch file.
Is this possible? if so, then could you post how to do so?

Regards,
Rileyh

Re: batch system variable that stays through different sessi

Posted: 03 Nov 2011 03:55
by Ed Dyreen
'

Code: Select all

reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /t REG_SZ /v "var" /f /d "value"

Re: batch system variable that stays through different sessi

Posted: 03 Nov 2011 10:08
by !k
or setX