How to edit a registry key for every profile, without knowing their name?

1

I want to change the registry key HKLM\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features\S-1-5-21-192855608-1092268202-2311440418-1001\FeatureStates in Batch. However,

S-1-5-21-192855608-1092268202-2311440418-1001

Appears to be unique for everyone, but i want the script to be usable without any major technical knowledge and having to go into regedit. I have found some ways to replicate some wildcard functionality, but they appear to not fit what i need.

Samuel Koch

Posted 2015-07-31T06:58:20.910

Reputation: 81

Are you trying to do this on a workgroup computer with fixed number of people or on domain joined computer where users frequently change their system? – pun – 2015-07-31T07:12:18.137

@The_IT_Guy_You_Don't_Like This is not a corporate enviroment, it's for online distribution. – Samuel Koch – 2015-07-31T07:16:37.353

Can you show what yuo've tried please – Dave – 2015-07-31T07:33:14.637

Answers

1

I don't have this key in my system, so below is for demonstration purpose only, you might need to modify the "reg add" line accordingly.

@echo off &setlocal
set cmd="wmic useraccount where name='%username%' get sid"
for /f "skip=1" %%i IN ( ' %cmd% ' ) DO if not defined SID set "SID=%%i"
echo %SID%

reg add HKLM\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features\%SID% /v FeatureStates  /t REG_DWORD /d 1

endlocal & @echo on

Chris.C

Posted 2015-07-31T06:58:20.910

Reputation: 1 038