App not getting removed from start up items after uninstallation
const key = new WinReg({
hive: WinReg.HKCU,
key: ‘SoftwareMicrosoftWindowsCurrentVersionRun’
});
const appName = 'airtel_reflect'; // Replace with your app name
key.remove(appName, (err) => {
if (err) {
console.error(`Failed to remove startup entry: ${err.message}`);
debugLogs.error(`Failed to remove startup entry: ${err.message}`);
} else {
console.log('Startup entry removed.');
debugLogs.info('Startup entry removed.');
}
});
const regDeleteCommand = REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /V "${appName}" /F
; exec(regDeleteCommand, (error, stdout, stderr) => { if (error) { console.error(Error removing startup entry: ${stderr}
); } else { console.log(Startup entry removed: ${stdout}
); } });
Jitendra Singh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.