Click here to Skip to main content
15,041,525 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created an application which must run automatically when windows start after application has been launched(ie. setup has been deployed) and the machine must turn off after the appliaction has exited.
I am confused to make these dont know how to use REGISTRY...
Thant means I want make entry into registry with data value must be the application exe path ie.the path must be the application folder wherever the application is installed.
So please I need a help...Thanks.
Updated 14-Sep-11 20:11pm
Prerak Patel 12-Sep-11 7:47am
Turn off machine when application is exited?! Why?

Yashodip Jagdale 13-Sep-11 6:27am
But sir,
I want to edit registry at the time of setup deployement and it must be removed when I want to remove the application.Then how to make the SETUP which can add/modify registry during installation/Uninstallation...Please help me sir..Thank you.
simple way is

open regedit from run

go to

right click -> new -> string Value -> give name (like "DEMO") ->
right click on Demo -> modify -> paste your exe file in value data (like c:\project\hello.exe) -> ok and restart your PC.
See Registry example

To run application on window startup
Sample Code.
'Write to register
Dim regKey As Microsoft.Win32.RegistryKeyregKey
regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
regKey.SetValue("YourApplicationName", "YourInstallPath")

If you want to remove from register use this code.
regKey.DeleteValue("YourApplicationName", False)

Also look at this Link :
Another method without using registry is to create a shortcut in Windows Startup Folder.

You can do this when you create installation file in Setup Project in Visual Studio. After you created a project, you can add startup folder into special folders (default: Desktop, and Program File).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900