I Deleted All Environment Variables

nazboy

Posts: 8   +0
Greetings,

I am wondering if any of you guys can help me out of this little problem. I was performing some maintenance on my brothers laptop a few days ago. He had been having some issues with huge memory dumps being created and so I went in to his advanced system settings and disabled the feature to create the dumps. For some reason while I was in there I decided to click that Environment Variables button, I selected all the variables in there and clicked 'Delete'. <<< STUPID!

Next day he contacted me to say that all hell had shook loose on his machine. Needless to say a giant finger came pointing at me as the guilty culprit. He stated that he:

Can't enable volume, just get error code:0x8000FFFF
Can't run system restore, just get an error message.
Can't run system maintenence, just get an error code.
Can't uninstall any programs.
Can't change any windows settings, just get an error message.

My first thought was to get him in to safe mode and do a system repair or to restore the old variables. Unfortunately when he tries to reboot with the F8 key nothing happens!?

The worst part of this is he lives 90 miles away so I am going to have to talk him through what to do.

If anyone can offer me some advice on restoring the original vars it would be most appreciated.

Thanks for listening.
 
Last edited:
Important issue is Which user-id were you using?
My suggestion is to RECREATE every variable :)sigh:) MANUALLY

The issue will be
  • some vars are dependent upon the actual hardware (cpu)
  • some dependent upon the software actually installed (eg %PATH%)
  • YOU need to understand and help figure out what the correct values of EVERY variable *must* be :sigh:
upload_2015-7-21_15-45-32.png

upload_2015-7-21_15-46-45.png

and the PATH to access installed programs:
upload_2015-7-21_15-49-8.png
 

Attachments

  • upload_2015-7-21_15-48-39.png
    upload_2015-7-21_15-48-39.png
    429.5 KB · Views: 16
Hi Joe, thanks for responding.

The User ID which I carried out this procedure on was my brothers main account.

When you say that I need to understand and help figure out what the correct values are of EVERY variable; can you please explain how I would go about that? I have to admit that I'm not sure what those Command screenshots you posted are supposed to be showing me.

My parents have this exact same laptop with the same hardware inside, they recently had a clean install of windows and I was wondering if it might be possible to take the variables from that machine and add them on my brothers. Maybe that will be more simple?

He has various software installed which my parents do not have. The priority I guess would be for me to get Windows working first then figure out the software variables later.

What do you think?
 
"my brothers main account" hmm, that's newbe for the Admin? No consequence -- move on.

Good approach IMO, as the second systems is "identical". You've nothing to loose, given the current state of affairs. btw: Boot into Safe Mode (strike F8 once / sec until you get B/W vga screen) and select the Admin Id.

set all the other stuff first, add this as the PATH variable
Code:
C:\Windows\SYSTEM32;C:\Windows;C:\Windows\SYSTEM32\WBEM;C:\Windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0\;
save and reboot
 
Yeh sorry the account is the main admin account on his Laptop. It is the only account he has had on there since he purchased the machine. I'm contacting him tonight to talk him through the stages of manually adding all the variables from parents laptop.

Thanks very much for the PATH variable. Will that work with Windows 8.1?

As previously mentioned he is having problems getting in to safe-mode, for some reason his laptop does not respond to the F8 key on boot. I haven't a clue why?

I'll keep you updated! ;)
 
Well what a mission that was. Brother could not even access 'Advanced System Settings' in order to manually add the variables because he kept getting an error. Regedit was also inaccessible.

I eventually found a way to reboot in to safe-mode without using F8 (by holding the shift key and clicking on power icon then restart in the Charms Bar). This rebooted the machine and took us to a Windows Recovery facility where we chose Advanced Repair Options > Troubleshoot > Advanced Options > Windows Startup Settings > Restart. After a reboot the option for safe-mode appears. Once in there I was able to access the command prompt but nothing else, I enabled the hidden Administrator account, but upon logging in to it we still had the same errors caused by the missing variables! (I guess the account just inherited them somehow).

Back in the Recovery Facility (holding shift+restart) we attempted to execute a system restore to a listed point two weeks previous, but this failed to complete throwing up another error. We also tried a system restore from within Safe Mode but that would not complete either.

So back to another attempt at the registry. Being as we were not able to access Regedit I decided to export the whole hive from parents identical laptop (stored in HKEY_LOCAL_MACHINE/System/CurrentControlSet/Control/Session Manager/Environment), and I emailed him the file.

At first he was unable to open it due to another error; 'The file was blocked because it does not have a valid digital signature'. To get around that we right-clicked the file, chose properties and clicked 'unblock'. After this he was able to execute it and all variables were added to the registry.

Thankfully that seemed to do the trick! We were now able to access everything in Windows again including System Restore, so just to make sure there were no conflicts between my parents variables and the ones on his machine we chose to roll the laptop back 2 weeks prior to the date on which I deleted the original variables.

A hard lesson learned but an interesting endeavor none-the-less.

Thanks for your advice :)
 
WOW - - certainly a nasty exercise.

Now that your are stable + bootable, here's what you do next.

Logon and change the Admin password.
while there
  • create new accounts for anyone who will be using this system and set them as a Limited User.
  • set the security level so as to Always Prompt for install permission.

NEVER login as admin to do anything other that updates.
 
Hey man, thanks again for your help. I have implemented the above as per your suggestion. I'll be putting this one down to experience.

All the best to you!
 
Lol I like how you deleted them all then got out of there like "whelp, my job here is done although I know I did a bad thing without fixing it" then waited for your brother to call you the next day. Maybe you shouldn't try to be tech support for your household... haha
 
Back