import win32api
import win32con
key = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE,’SOFTWARE’,0,win32con.KEY_ALL_ACCESS)
error reporting pywintypes.error: (5, ‘RegOpenKeyEx’, ‘xbe\ xbe\xf8\xb7\xc3\ xca\xa1\xa3’)
then the positioning problem occurred in win32con.key_all_access, which was due to the willingness of the registry access to be denied, so the access permission needed to be increased, by the following methods:
the first method:
WIN7 has administrator privileges:
1. Right-click computer, go to administration, and find users and groups.
2. Find administrators, right-click to bring up the property, and remove the check mark before “this account is disabled”.
back to the desktop
3. Create a new “notepad” and copy as follows:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\runas]
@=” administrator takes ownership”
“NoWorkingDirectory”=””
[HKEY_CLASSES_ROOT\*\shell\runas\command]
@=”cmd.exe /c takeown /f \”%1\” & & icacls \”%1\” /grant administrators:F”
“IsolatedCommand”=”cmd.exe /c takeown /f \”%1\” & & icacls \”%1\” /grant administrators:F”
[HKEY_CLASSES_ROOT\exefile\shell\runas2]
@=” administrator takes ownership”
“NoWorkingDirectory”=””
[HKEY_CLASSES_ROOT\exefile\shell\runas2\command]
@=”cmd.exe /c takeown /f \”%1\” & & icacls \”%1\” /grant administrators:F”
“IsolatedCommand”=”cmd.exe /c takeown /f \”%1\” & & icacls \”%1\” /grant administrators:F”
[HKEY_CLASSES_ROOT\Directory\shell\runas]
@=” administrator takes ownership”
“NoWorkingDirectory”=””
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@=”cmd.exe /c takeown /f \”%1\” /r /d y & & icacls \”%1\” /grant administrators:F /t”
“IsolatedCommand”=”cmd.exe /c takeown /f \”%1\” /r /d y & & icacls \”%1\” /grant administrators:F /t”
and then save as win7 to get administrator privileges. Reg, suffix must be.reg
imports the saved registry information, thus gaining WIN7 administrator rights.
right click on the folder and “administrator takes ownership” will appear
the second method:
ctrl+r
input lusrmgr. MSC
user — double-click administrator to uncheck the “account disabled” check
logout
select administrator account to log in
Read More:
- Error: (2, ‘RegOpenKeyEx’, error resolution
- torch.cuda.is_ Available() returns false
- VBA returns “n / a” and other error information
- @Value gets the configuration file value and returns null
- About MySQL error: subquery returns more than 1 row
- Error server returns invalid timezone. Need to set ‘servertimezone’ property
- Java regular matching returns all matches
- Macfee can not be upgraded, the prompt returns an error
- Opencv’s imread() function returns null when reading images
- Python TCP socket programming: send returns broken pipe error?
- After the model is instantiated by keras, the result returns nonetype
- Create an Apex class that returns contacts based on incoming parameters
- Idea: server returns invalid timezone. Need to set ‘servertimezone’ property
- Postman returns to the data window and displays the JSON format by default
- How to Solve mybatis returns null when querying Oracle database with char type field
- Curl returns empty reply from server. Due to the processing of special characters, curl cannot be accessed and the browser can access it.
- Anaconda returns Python 3.7 to Python 3.6
- Top35: pychar reports an error when connecting to MySQL server returns invalid timezone. Need to set ‘servertimezone’ property
- Win10 can’t drag files to open directly