Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ECHO OFF
- SETLOCAL EnableDelayedExpansion
- SET DEST="%~1"
- ECHO %DEST%
- FOR /f "tokens=*" %%G in ('dir /b /a:d-s-l "%SystemDrive%\Users"') DO (
- IF /I NOT "%%G"=="Public" (
- reg.exe load HKU\XYZ "%SystemDrive%\Users\%%G\NTUser.dat"
- IF NOT ERRORLEVEL 1 (
- call :regchanges XYZ
- reg.exe unload HKU\XYZ
- )
- )
- )
- FOR /f "tokens=1,2 skip=1" %%G IN ('wmic.exe PATH Win32_UserProfile get loaded^,sid') DO (
- IF /I "%%G"=="True" (
- set sid=%%H
- IF /I "!sid:~0,8!"=="S-1-5-21" (
- call :regchanges !sid!
- )
- )
- )
- exit /b
- :regchanges
- REM reg.exe add "HKU\%1\..." /v ... /t ... /d ... /f
- reg.exe add "HKU\%1\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v Win10UpgradeMessage /t REG_SZ /d "cmd.exe /c start /D %DEST% UI++64.exe /config:UpgradeInProgress.xml" /f
- REM reg.exe add "HKU\%1\Software\Temp3" /v TempValue /t REG_SZ /d "A sub Test" /f
Advertisement
Add Comment
Please, Sign In to add comment