How To Write To The Windows 7 Registry HKLM

1

0

I'm writing a vbscript that will write a registry value, to be precise the script should write the value of DisableRemovableDriveScanning value 0 to

HKLM\Software\Microsoft\Microsoft Antimalwre\Scan\

but I soon realized that this doesn't work, because of user permissions.

I thought of saving the entries as a .reg and using the runas command to call the .reg file from a script as SYSTEM, but I don't know if it would work, and I haven't tried it out yet.

Would someone out there know of a way to write to HKLM?

I'm using Windows 7 64 Bit

Thanks

user181734

Posted 2013-04-03T21:13:37.200

Reputation:

Where is the code, an Admin should be able to write there, not as system but as a local admin – Austin T French – 2013-04-03T21:28:38.377

Code is wshShell.RegWrite "HKLM\Software\Microsoft\Microsoft Antimalwre\Scan\DisableRemovableDriveScanning", 0, "REG_DWORD" and run in vbs as administrator – None – 2013-04-03T21:37:45.993

2I would try your idea then update your question if you want people to help you. Your script file is exactly how I would do something like this. – Ramhound – 2013-04-04T11:59:51.227

Thanks, I have tried everything that I could think of but it would not work, since the value is locked by the Microsoft Antimalware process (MSE) and this process cannot be disabled, so I'm stuck. – None – 2013-04-04T15:53:27.893

No answers