Now the reg keys to set the apropriate settings to me is shown below and are unique keys to each user. Is there a way to thorugh batch query this string and apply the settings I want?
The registry keys:
[HKEY_USERS\S-1-5-21-1085031214-1682526488-1343024091-1003\SOFTWARE\Microsoft\MSNMessenger\PerPassportSettings\851604443] "DisableMSNToday"=hex:01,00,00,00 "DisableTabs"=dword:00000001
Here is how you can set SID as a variable. (Creds to Yzöwl)
@echo off&setlocal enableextensions
for /f "tokens=*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" /s^|findstr "S-1-5-"') do (
for /f "tokens=1,3 delims= " %%b in ('reg query "%%~a" /v "ProfileImagePath"') do (
if errorlevel 0 (
echo/%%~c|find "%userprofile%">nul
if errorlevel 0 set UserSID=%%a
)
)
)
if not defined UserSID echo/ SID not found&&endlocal&goto :eof
set UserKey=HKU\%UserSID:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\=%
Echo %UserKey% is set to %%UserKey%%
endlocal&goto :eof



Help

Back to top








