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. how to use runonce registry service?

how to use runonce registry service?

Scheduled Pinned Locked Moved C#
csharpwindows-adminhelptutorialquestion
8 Posts 5 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.
  • A Offline
    A Offline
    Ajithevn
    wrote on last edited by
    #1

    Hi all i have no idea about run services.i googled a lot but i could not find much of help. plz help me about:- 1)how to use runonce registry service? 2)can i use it from my c# application? 3)i got to know that i need to create a batch file, can that batch file be destroied after it is being executed? http://www.catch22.net/tuts/selfdel[^] i have checked this link from this only i got few ideas 4)can the batch file contain task to be performed on shutdown of the system if so can yo help me with a sample? 5)where to place the batch file and when to execute it from my application?

    C 1 Reply Last reply
    0
    • A Ajithevn

      Hi all i have no idea about run services.i googled a lot but i could not find much of help. plz help me about:- 1)how to use runonce registry service? 2)can i use it from my c# application? 3)i got to know that i need to create a batch file, can that batch file be destroied after it is being executed? http://www.catch22.net/tuts/selfdel[^] i have checked this link from this only i got few ideas 4)can the batch file contain task to be performed on shutdown of the system if so can yo help me with a sample? 5)where to place the batch file and when to execute it from my application?

      C Offline
      C Offline
      Calla
      wrote on last edited by
      #2
      1. Maybe this registry key will give you a hint: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce 2) I don't know how you want to use it from your c# application, but "yes" you can launch a c# application via RunOnce. 3) Why do you need to have a self destructing batch file? Maybe you could let some other part of your app delete the file. 4) Don't know. 5) Please provide more info. I have no clue where you could/should/would place your bat file and I'm even more clueless of when to execute it from your app..
      A 1 Reply Last reply
      0
      • C Calla
        1. Maybe this registry key will give you a hint: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce 2) I don't know how you want to use it from your c# application, but "yes" you can launch a c# application via RunOnce. 3) Why do you need to have a self destructing batch file? Maybe you could let some other part of your app delete the file. 4) Don't know. 5) Please provide more info. I have no clue where you could/should/would place your bat file and I'm even more clueless of when to execute it from your app..
        A Offline
        A Offline
        Ajithevn
        wrote on last edited by
        #3

        1)HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce how to invoke this? or call this? or execute this key? 2)can we uninstall a setup created for a c# windows application on shutdown of system using RunOnce.

        C D C 3 Replies Last reply
        0
        • A Ajithevn

          1)HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce how to invoke this? or call this? or execute this key? 2)can we uninstall a setup created for a c# windows application on shutdown of system using RunOnce.

          C Offline
          C Offline
          Calla
          wrote on last edited by
          #4
          1. Have you tried placing a string value here with a path to an executable as value..? 2) I believe that the OS checks the RunOnce (and starts the executables) on startup - not on shut down.
          1 Reply Last reply
          0
          • A Ajithevn

            1)HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce how to invoke this? or call this? or execute this key? 2)can we uninstall a setup created for a c# windows application on shutdown of system using RunOnce.

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            Ajithevn wrote:

            1)HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce how to invoke this? or call this? or execute this key?

            You don't have a clue what the registry is or how it works, do you? You cannot "invoke" that key, or "execute" anything in the registry any time you want. All the registry is is a hierarchical database of information. There is nothing "executable" in it at all. The RunOnce key is just a list of command lines that Windows executes on startup.

            Ajithevn wrote:

            2)can we uninstall a setup created for a c# windows application on shutdown of system using RunOnce.

            Since RunOnce command lines only get execute when Windows starts, no.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008
            But no longer in 2009...

            L 1 Reply Last reply
            0
            • D Dave Kreskowiak

              Ajithevn wrote:

              1)HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce how to invoke this? or call this? or execute this key?

              You don't have a clue what the registry is or how it works, do you? You cannot "invoke" that key, or "execute" anything in the registry any time you want. All the registry is is a hierarchical database of information. There is nothing "executable" in it at all. The RunOnce key is just a list of command lines that Windows executes on startup.

              Ajithevn wrote:

              2)can we uninstall a setup created for a c# windows application on shutdown of system using RunOnce.

              Since RunOnce command lines only get execute when Windows starts, no.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008
              But no longer in 2009...

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Heh, that's why I steered clear of this one. :thumbsup:

              Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]

              D 1 Reply Last reply
              0
              • L Lost User

                Heh, that's why I steered clear of this one. :thumbsup:

                Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                Yeah, but someone has to step in it. Don't worry, I brought a stick to scrape the stuff off my shoes.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008
                But no longer in 2009...

                1 Reply Last reply
                0
                • A Ajithevn

                  1)HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce how to invoke this? or call this? or execute this key? 2)can we uninstall a setup created for a c# windows application on shutdown of system using RunOnce.

                  C Offline
                  C Offline
                  Christian Graus
                  wrote on last edited by
                  #8

                  Ajithevn wrote:

                  or execute this key?

                  How do you know about it ? Because you can't execute a registry key. You obviously have just enough knowledge to be dangerous.

                  Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                  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