registry

Some CLSID Registry keys exist but cannot be read

早过忘川 提交于 2020-12-06 13:02:47
问题 I have following program that reads all CLSID registry keys and displays their name on a listbox; it is written in Delphi, but the question is not specific to Delphi; it is rather a question about the Windows Registry. procedure TForm2.Button1Click(Sender: TObject); var guid: string; reg: TRegistry; sl: TStringList; i: Integer; name: string; begin memo1.Clear; reg := TRegistry.Create; sl := TStringList.Create; memo1.Lines.BeginUpdate; try reg.RootKey := HKEY_CLASSES_ROOT; if reg

Python - checking if a user has administrator privileges

痞子三分冷 提交于 2020-11-26 09:23:32
问题 I'm writing a little program as a self-learning project in Python 3.x. My idea is for the program to allow two fields of text entry to the user, and then plug the user's input into the value of two specific registry keys. Is there a simple way to make it check if the current user can access the registry? I'd rather it cleanly tell the user that he/she needs administrator privileges than for the program to go nuts and crash because it's trying to access a restricted area. I'd like it to make

Python - checking if a user has administrator privileges

无人久伴 提交于 2020-11-26 09:22:06
问题 I'm writing a little program as a self-learning project in Python 3.x. My idea is for the program to allow two fields of text entry to the user, and then plug the user's input into the value of two specific registry keys. Is there a simple way to make it check if the current user can access the registry? I'd rather it cleanly tell the user that he/she needs administrator privileges than for the program to go nuts and crash because it's trying to access a restricted area. I'd like it to make