-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrestore-env.py
More file actions
21 lines (18 loc) · 866 Bytes
/
restore-env.py
File metadata and controls
21 lines (18 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os
def restore_env_variables(file_path):
with open(file_path, 'r') as file:
for line in file:
key, value = line.strip().split('=', 1)
os.environ[key] = value
# Restore system and user environment variables
restore_env_variables('env_variables_backup.txt')
#C:\flutter_windows_3.27.1-stable\flutter\bin
#C:\Program Files (x86)\Windows Kits\10\Lib\10.0.26100.0
#C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0
#C:\Users\zx\AppData\Local\Programs\Python\Python312\Scripts\
#C:\Users\zx\AppData\Local\Programs\Python\Python312\
#%USERPROFILE%\AppData\Local\Microsoft\WindowsApps
#%USERPROFILE%\.dotnet\tools
#C:\Users\zx\AppData\Local\Programs\Microsoft VS Code\bin
#D:\code\vcpkg-master
#C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64