Set permanent variable in cmd


  1. Posts : 44
    PA - Pennsylvania
       #1

    Set permanent variable in cmd


    I am trying to find a way to set a variable in the cmd that is "permanent".

    What I mean is that I could set the variable %message% to "hello", and I could close the cmd, open it up a week later and if I typed this:
    Code:
    echo %message%
    This would be the result
    Code:
    hello
    Using the normal SET command will only set the variable for the time the cmd is open. I need to set the variable within the system so that it will stay if I close the cmd.
      My Computer


  2. Posts : 44
    PA - Pennsylvania
    Thread Starter
       #2

    it's been an hour, so...

    BUMP
      My Computer


  3. Posts : 6,285
    Windows 10 Pro X64
       #3

    Use the Setx command: Setx
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 11:14.
Find Us