本帖最后由 小白龙 于 2022-11-13 18:07 编辑
回复 1# fly9902 - #@&cls&powershell "gc '%~f0'|out-string|iex"&pause&exit
- $a = @'
- C:\Users\Fast\AppData\Roaming=$APPDATA
- C:\Windows\system32=$SYSDIR
- '@ | ConvertFrom-StringData
-
- $b = @'
- WriteRegStr HKCU "Software\3DMAX\R23.2\6101:804" "RoamableRootFolder" "C:\Users\Fast\AppData\Roaming\"
- WriteRegStr HKCU "Software\3DMAX\R23.2\6101:804" "SystemFolder" "C:\Windows\system32\"
- '@ -split '\r?\n'
-
- foreach ($b_ in $b)
- {
- foreach ($ak in $a.Keys)
- {
- $ake = [regex]::Escape($ak)
- if ($b_ -match $ake)
- {
- $av = ($a.GetEnumerator() | ? name -EQ $ak).Value
- $b_ -replace $ake, $av
- }
- }
- }
复制代码
|