Issue: An administrator prohibits a user from accessing the registry causing the call to fail
The call failed due to a ban on access to the registry “reg query “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography” /v MachineGuid”
My temporary fix is to use powershell instead of cmd
Here’s how I did it:
path: C:\Users\username\AppData\Local\Programs\cursor\resources\app\out\vs\code\electron-main\main.js
Open this file and find const w
Then modify it as shown in the figure
win32: `${{native:"%windir%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32",notdefined:""}[f()]} “Get-ItemProperty -Path ‘HKLM:\SOFTWARE\Microsoft\Cryptography’ -Name MachineGuid”`,
Modify it after the const w is modified
function u(y) {
switch (O.platform) {
case "darwin":
return y.split("IOPlatformUUID")[1].split(`
`)[0].replace(/\=|\s+|\"/ig, "").toLowerCase();
case "win32":
return y.toString().split("REG_SZ")[1];
case "linux":
return y.toString().replace(/\r+|\n+|\s+/ig, "").toLowerCase();
case "freebsd":
return y.toString().replace(/\r+|\n+|\s+/ig, "").toLowerCase();
default:
throw new Error(`Unsupported platform: ${process.platform}`)
}
}
Before:
case "win32":
return y.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/ig, "").toLowerCase();;
After
case "win32":
return y.toString().split("REG_SZ")[1]
Deleted replace(/\r+|\n+|\s+/ig, “”).toLowerCase()
Once you’ve done this, you’ll open the Cursor interface, but you’ll see some error messages. It’s just that I tried it, and the function of AI programming was not affected, so I didn’t delve into it.
Since I’m using Windows, I’ve only modified the Win32 code. Hope it helps