For more information about openkey, see!

Source: Internet
Author: User
For more information about openkey, see! Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiAPI/html/delphi_20061106111720296.html
I wrote a loan code to disable the USB flash drive.
VaR
Reg: Tregistry;
Begin
Reg. rootkey: = HKEY_LOCAL_MACHINE;
If Reg. openkey ('\ System \ CurrentControlSet \ Services \ usbstor', true) then
Begin
Reg. writeinteger ('start', 4 );
Reg. close;
Reg. Free;
End
Else showmessage ('error ');

End;

But what I don't understand is that it runs normally under the administrator user and can lock the USB flash drive. however, running in a power users user shows a 'error'. I also saw that this key exists under this user, but it cannot be used. Program Change the settings (it seems that the openkey cannot be found). This is really strange. Please help us to see why. Thank you.




The user in the Power Users Group has no permission to modify this key value.

To do2008 (the thing is done) () reputation: 100 blog
I still don't understand. How should I modify it ?. I think if an EXE file is generated, it should be run in the same way under any user?

I think if an EXE file is generated, it should be run in the same way under any user.
========================================================== ========================================================== ===
Some system settings only support administrator, and your program can be modified by the administrator user. Other users cannot modify the program, which means other users do not have the permission to modify the key value, unless you redefine other user permissions as administrator permissions

Maozefa (AFA )~~~ Positive Solution ~~~
In Windows, Administrators have the highest permissions for Windows and can execute important system configurations;

However, other user group members may not have relevant permissions. If all users, such as guest and users, have permissions,
Windows does not need to be mixed up ~~~

For which operations require permissions, You need to query relevant information, such as msdn ~~~



Run regedit.exe and use the tool menu to modify this permission.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.