batch system variable that stays through different sessions

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Rileyh
Posts: 147
Joined: 01 Sep 2011 03:54
Location: Perth, Western Australia

batch system variable that stays through different sessions

#1 Post by Rileyh » 03 Nov 2011 00:55

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

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: batch system variable that stays through different sessi

#2 Post by Ed Dyreen » 03 Nov 2011 03:55

'

Code: Select all

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

!k
Expert
Posts: 378
Joined: 17 Oct 2009 08:30
Location: Russia

Re: batch system variable that stays through different sessi

#3 Post by !k » 03 Nov 2011 10:08

or setX

Post Reply