How can i remove my application on startup in registery?

To remove the application from the Windows registry, you can use the TRegistry class in Delphi and delete the key that you created earlier. Here are the steps in detail:

  1. In your Delphi project, add the “Registry” unit to the uses clause of your main form’s unit.
  2. In the FormClose event of your main form, add the following code:

This code opens the Run key in the Windows registry and deletes the value that you created earlier, which corresponds to your application.

  1. Run the application once, it will delete the registry key and your application will no longer start automatically when the user logs in.

Alternatively, you can delete the key manually, by opening the registry editor (pressing “Windows+R” and typing “regedit”) and navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run and delete the key ‘YourApp’

It’s important to note that in order to delete a key in the Windows registry, the user must have administrative privileges.

In case of scheduled task, you can use the command prompt or the windows task scheduler to delete the task.

In case of windows service, you can use the command prompt or the services.msc to delete the service.

In summary, you can remove your Delphi application from startup by deleting the corresponding shortcut from the Startup folder, delete the registry key, delete the scheduled task or delete the windows service.


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *