Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Adding Application on windows start up

Adding Application on windows start up

Scheduled Pinned Locked Moved C#
questioncsharp
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    Zapss
    wrote on last edited by
    #1

    Hello, how can i add c# application on windows start up. i dont want to add in start up folder.Is there any othere way? like yahoo messanger which is not appeared:doh: in start up folder..

    N 1 Reply Last reply
    0
    • Z Zapss

      Hello, how can i add c# application on windows start up. i dont want to add in start up folder.Is there any othere way? like yahoo messanger which is not appeared:doh: in start up folder..

      N Offline
      N Offline
      Nnamdi Onyeyiri
      wrote on last edited by
      #2

      Put a value for it in one of the following folders. For All users: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run For the current users: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run


      website // Project : AmmoITX //profile Another Post by NnamdiOnyeyiri

      Z 1 Reply Last reply
      0
      • N Nnamdi Onyeyiri

        Put a value for it in one of the following folders. For All users: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run For the current users: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run


        website // Project : AmmoITX //profile Another Post by NnamdiOnyeyiri

        Z Offline
        Z Offline
        Zapss
        wrote on last edited by
        #3

        How can i add this from c# application?any example

        N M 2 Replies Last reply
        0
        • Z Zapss

          How can i add this from c# application?any example

          N Offline
          N Offline
          Nnamdi Onyeyiri
          wrote on last edited by
          #4

          using Microsoft.Win32;
          .....
          RegistryKey hkcu = Registry.CurrentUser;
          RegistryKey run = hkcu.OpenSubKey("Software\\Microsoft\\Windows\\CurrentUser\\Run");

          run.SetValue("MySoftware", "C:\\Path\\To\\Software.exe");

          something like that should do the trick.


          website // Project : AmmoITX //profile Another Post by NnamdiOnyeyiri

          1 Reply Last reply
          0
          • Z Zapss

            How can i add this from c# application?any example

            M Offline
            M Offline
            Member 1272381
            wrote on last edited by
            #5

            using Microsoft.Win32; string strAssemblyPath; strAssemblyPath = System.IO.Path.GetDirectoryName(base.Context.Parameters[ASSEMBLYPATH_STATENAME]); Process.Start(strAssemblyPath+"\\Application.exe"); RegistryKey MainKey; MainKey=Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths"); RegistryKey ApplicationKey=MainKey.OpenSubKey("Application",true); ApplicationKey.SetValue("Application.exe",strAssemblyPath+"\\Application.exe"); Check the Above code written in c#. This Code i have written for writting my application path into registry. And u can add the application to the Start up in another way also. Check while creating setup u can create a chort cut to the start menu startup folder. that will also run the application. Arun Kumar Sabat

            Z 1 Reply Last reply
            0
            • M Member 1272381

              using Microsoft.Win32; string strAssemblyPath; strAssemblyPath = System.IO.Path.GetDirectoryName(base.Context.Parameters[ASSEMBLYPATH_STATENAME]); Process.Start(strAssemblyPath+"\\Application.exe"); RegistryKey MainKey; MainKey=Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths"); RegistryKey ApplicationKey=MainKey.OpenSubKey("Application",true); ApplicationKey.SetValue("Application.exe",strAssemblyPath+"\\Application.exe"); Check the Above code written in c#. This Code i have written for writting my application path into registry. And u can add the application to the Start up in another way also. Check while creating setup u can create a chort cut to the start menu startup folder. that will also run the application. Arun Kumar Sabat

              Z Offline
              Z Offline
              Zapss
              wrote on last edited by
              #6

              Thanks for your replay. i have another doubt? how can i hold system shut down process until user close my c# application properly...

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups