Need an Hkey_Current_User trick

(imported topic written by jtedesco91)

I am trying to modify a registry value under HKCU to update our Blackberries for DST.

I have not had any luck using runascurrentuser along with a batch file. __download\runascurrentuser.exe __download"BB DST.bat"

So I am now trying to use relevance substitution, and still not getting anywhere.

dos reg delete {""} /v parameters /f

dos reg delete {""} /v parameters /t reg_dword /d 18

Any Ideas how I can modify this value?

(imported comment written by BenKus)

Hi jtedesco,

Cool! I have never seen this “reg delete” command.

I think maybe you have a syntax issue with the “reg delete” command:

dos reg delete {“HKCU”& (name of key whose ((it = name of current user as lowercase OR it starts with name of current user as lowercase & “@” ) of (it as string as lowercase) of value “Logon User Name” of key “Software\Microsoft\Windows\CurrentVersion\Explorer” of it) of key “HKEY_USERS” of registry) & “\Software\Research In Motion\Blackberry\Synchronize”} /v parameters /f

dos reg delete {“HKCU”& (name of key whose ((it = name of current user as lowercase OR it starts with name of current user as lowercase & “@” ) of (it as string as lowercase) of value “Logon User Name” of key “Software\Microsoft\Windows\CurrentVersion\Explorer” of it) of key “HKEY_USERS” of registry) & “\Software\Research In Motion\Blackberry\Synchronize”} /v parameters /t reg_dword /d 18

Perhaps you might need to have extra quotes (") around before the ‘{’ and after ‘}’ if the reg delete requires quotes around the key name.

Ben

(imported comment written by brolly3391)

Hello jtesesco,

The reg command is only available in XP forward, so don’t try to use this method on Windows 2000 machines. With that said, you can use REG ADD instead of DELETE to create/change keys.

more on the syntax at this MS web address:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/reg.mspx?mfr=true

dos reg add “{”"}" /v parameters /t reg_dword /d 18

Cheers,

Brolly

(imported comment written by BenKus)

Note that BES 7.0 introduces new inspectors to easily get to the “HKEY_CURRENT_USER” branch of the registry for logged on users:

http://forum.bigfix.com/viewtopic.php?id=1187

Ben

(imported comment written by SystemAdmin)

Brolly,

If you want the REG command for Windows 2000, it’s part of the support tools found on the Windows 2000 CD. So you’d need to download it to a 2000 PC first.

http://www.microsoft.com/technet/scriptcenter/guide/sas_sbp_hhla.mspx?mfr=true

It’s an alternative to creating a .REG file to delete entries via a regedit “import”.

-Paul

(imported comment written by brolly3391)

Hey Paul,

Don’t tell anyone, but I usually just copy the XP version of reg.exe out to the 2000 boxes that I need to use it on. I have not seen any issues yet.

Cheers,

Brolly