Purpose: Modify or add the system path environment variable. If there is c:\123 in the environment variable, delete it. If there is no %System32%\qqq, add that path.
I used regedit /e or reg export in batch to export the HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment key in the registry, but the exported path is in the following hexadecimal number form and has multiple lines:
"ComSpec"=hex(2):25......
"Path"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,\
00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,3b,00,25,00,\
53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,3b,00,25,\ .........
"FP_NO_HOST_CHECK"="NO"
"OS"="Windows_NT"
"PROCESSOR_ARCHITECTURE"="x86"
........
Asking experts:
1. How to only keep the path key in the exported registry key (keep multiple lines completely)
2. How to modify the existing path and add a new path
Note: The path obtained by set path in cmd is all absolute paths, not relative paths in the registry. I want to get relative paths, and absolute paths seem unable to be imported into the registry to change the path value.
[ Last edited by HAT on 2008-10-22 at 09:48 ]
I used regedit /e or reg export in batch to export the HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment key in the registry, but the exported path is in the following hexadecimal number form and has multiple lines:
"ComSpec"=hex(2):25......
"Path"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,\
00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,3b,00,25,00,\
53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,3b,00,25,\ .........
"FP_NO_HOST_CHECK"="NO"
"OS"="Windows_NT"
"PROCESSOR_ARCHITECTURE"="x86"
........
Asking experts:
1. How to only keep the path key in the exported registry key (keep multiple lines completely)
2. How to modify the existing path and add a new path
Note: The path obtained by set path in cmd is all absolute paths, not relative paths in the registry. I want to get relative paths, and absolute paths seem unable to be imported into the registry to change the path value.
[ Last edited by HAT on 2008-10-22 at 09:48 ]
Recent Ratings for This Post
( 1 in total)
Click for details
| Rater | Score | Time |
|---|---|---|
| — | +1 | 2010-09-03 09:21 |

