regedit - Powershell and registry key changing challenge -


i make changes under hklm line this:

 set-location hklm:\software\afilefolder\afilefolder 

and works. need make change current user key, told making change hkey_users, have 5 machines run script , based on machine is, need make change location, because hkey_users has sid next file folder , changes each user. based on user, grab sid, have of them. , set location this:

$test = "hkey_users\" + $hkeypath + "\filefolder\filefolder" set-location $test 

i cannot put concatenation in set-location line, powershell no likey, when way, says following path cannot found: c:\windows\system32\hkey_users\correctsid\filefolder\filefolder

why in system32 folder? how make changes hkey_user. please advise

you can set location fine, string concatenation, put whole thing in double quotes. you'll want reference it's in registry safe, try out:

set-location "registry::hkey_users\$hkeypath\filefolder\filefolder" 

that worked me (well, set sid $mysid , did set-location "registry::hk_users\$mysid\software" , got me software key in registry, under sid).


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -