How To Reset Enviornment Variables?

redmagic

Honorable
Jun 15, 2013
10
0
10,510
For some reason my %WINDIR% environment variable got deleted, I really have no idea why or how. Due to this, I can't open any programs aside from cmd and a few others to replace the variable. I tried resetting in the command line but it would not save probably due to the fact that I was not running it in administrator which I can't do either. Are there any ways to fix this or am I going to have to do a system repair? (I can't seem to run the system restore program either, so that is out of the question.

Thanks
 
Solution
can you bring up the command window as administrator? If not then you are most likely out of luck.

EDIT: if you can access command window as administrator, type this and see if it replaces the files. "sfc scannow" without quotes.

redmagic

Honorable
Jun 15, 2013
10
0
10,510

Do you mean the ability to open files with "run as admin" or just have an administrator account (which I am).
 
can you bring up the command window as administrator? If not then you are most likely out of luck.

EDIT: if you can access command window as administrator, type this and see if it replaces the files. "sfc scannow" without quotes.
 
Solution

redmagic

Honorable
Jun 15, 2013
10
0
10,510

Alright, it seems I can not run the program as admin. What should I do now then? I booted into one of the system repair disks and tried to use a system restore point but unfortunately it did not work.

 

redmagic

Honorable
Jun 15, 2013
10
0
10,510
Okay, I was able to re add the %windir% variable in Safe Mode using the setx command (setx windir %SYSTEMROOT%), but most things still do not work. I still can't open any control panel programs or most of anything really. Should I just reinstall Windows or is there anything else I can do.