Jump to content

Hi LinusTechTips forum,

  So earlier today, I was actually figuring out a way to edit some system environment variables (to be accurate, adding Python to Path) using Command Prompt. So I researched on the Internet how to do it. Heard about setx command and tried it out. At first, I thought about trying on VMware first but I was not thinking about the outcome so I tried it on my system (lol). The command I used is "setx Path "C:\Users\(my username)\AppData\Local\Programs\Python\Python37-32 /m". So I rechecked in the Environment Variables section and I figured out that I changed the whole Path crap. I have tried System Recovery so far but failed on error 0x8007045b, then I tried on WinRE and get error 0x8007007e. It said that it failed to extract the original copy of the directory from the restore point. The source is from %ProgramFiles%\WindowsApps, destination AppStaging or something like that. I want to undo this action immediately.

 

Please help.

Link to comment
https://linustechtips.com/topic/1087365-accident-on-setx-command/
Share on other sites

Link to post
Share on other sites

On 7/27/2019 at 11:19 PM, David Anderson said:

Hi LinusTechTips forum,

  So earlier today, I was actually figuring out a way to edit some system environment variables (to be accurate, adding Python to Path) using Command Prompt. So I researched on the Internet how to do it. Heard about setx command and tried it out. At first, I thought about trying on VMware first but I was not thinking about the outcome so I tried it on my system (lol). The command I used is "setx Path "C:\Users\(my username)\AppData\Local\Programs\Python\Python37-32 /m". So I rechecked in the Environment Variables section and I figured out that I changed the whole Path crap. I have tried System Recovery so far but failed on error 0x8007045b, then I tried on WinRE and get error 0x8007007e. It said that it failed to extract the original copy of the directory from the restore point. The source is from %ProgramFiles%\WindowsApps, destination AppStaging or something like that. I want to undo this action immediately.

 

Please help.

you can use the reg back to restore the registry to before you made the system change.

follow these steps.

https://pureinfotech.com/restore-registry-backup-windows-10/

 

this assumes your not using 1803 which decided to remove the regback files.

see, https://support.microsoft.com/en-ca/help/4509719/the-system-registry-is-no-longer-backed-up-to-the-regback-folder-start

 

if thats the case, use same steps but instead load registry hive and manually repair

boot in to restore environment

open command prompt

open regedit

highlight HKLM

menu\ file \ load

browse to c:\windows\system32\config\system

call key sys_repair

 

navigate to HKLM\sys_repair\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

 

set the path key back to original

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%systemroot%\System32\WindowsPowerShell\v1.0\;

 

highlight sys_repair key

menu \ file \ unload

 

reboot

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×