Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Set permanent variable in cmd

18 Jul 2012   #1
Mister Fox

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:
echo %message%
This would be the result
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 System SpecsSystem Spec
18 Jul 2012   #2
Mister Fox


it's been an hour, so...

My System SpecsSystem Spec
18 Jul 2012   #3

Windows 10 Pro X64

Use the Setx command: Setx
My System SpecsSystem Spec


 Set permanent variable in cmd

Thread Tools

Similar help and support threads
Thread Forum
name/env variable for networked computers
I have a couple of computers running on a local network, connected via a Technicolor 105+ TC8305C (xfinity router) most are wired, but 2-3 are wireless. My ISP is comcast. I think we use cable. Everyone uses Norton 360 Premier Edition. My IPCONFIG -all - ^That was because of...
Network & Sharing
Variable SLEEP behavior.
Running Win 7 Home Premium on a custom desktop, all updates applied. Regardless of what happens to be running at the time, when I issue the SLEEP command at night, the HD stops spinning, the monitor goes dark, and the power light starts blinking. Then the following morning: 1) 5% of the time,...
Performance & Maintenance
Very variable startup speed
Hi, I am running Windows 7 Home Premium 64bit on a 1.8 Tb Hard Drive of which only 500 gb is formatted. I bought the PC from Aria in Manchester, UK in May. Computer has 16 Gb RAM. As far as I know the drivers etc. and Windows updates are all up to date.
General Discussion
Variable speed dvd burning
Hi all, I have an LG GH22NS50 burner and am having trouble with burning movies. When using Ritek 8x speed I get frame stutter but if i use an old Verbatim DVD-RW I've got, which is 2x speed, no problem. The burner seems to burn at the rated media speed so I'm wondering if there is (a) any new...
Hardware & Devices
repeated variable bsods
I keep getting irregular bsods. One is in Photoshop CS5, which was the last before I generated the Windows_NT6_BSOD_jcgriff2 report. Only happens with certain adjustments such as image adjust exposure. Sometimes only hangs PS, others bsod. May also happen seemingly randomly like double...
BSOD Help and Support

Our Sites

Site Links

About Us

Find 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 00:54.
Twitter Facebook Google+