Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


share|improve this question
Where is the code, an Admin should be able to write there, not as system but as a local admin – AthomSfere Apr 3 '13 at 21:28
Code is wshShell.RegWrite "HKLM\Software\Microsoft\Microsoft Antimalwre\Scan\DisableRemovableDriveScanning", 0, "REG_DWORD" and run in vbs as administrator – James Young Apr 3 '13 at 21:37
I 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 Apr 4 '13 at 11:59
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. – James Young Apr 4 '13 at 15:53

You must log in to answer this question.

Browse other questions tagged .