Could someone remind me what the key is for running an app on startup, and is it possible to do the same thing on shutdown?- CHEEEEEEEERS.
Printable View
Could someone remind me what the key is for running an app on startup, and is it possible to do the same thing on shutdown?- CHEEEEEEEERS.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
That one you mean?
Erm, dunno Judd. I was thinking I might put the name of the file I want to run in somewhere. Can I do this on Startup and Shutdown?
For startup to run the program once (i.e. only on the next restart) use the Key I already gave.
To run on startup everytime use
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
(Have a look there and you'll see what you need to enter)
I don't know about shutdown....
:cool:
Dan
If you want your app to run at shut down the only way I know is to make it into a TSR. This means that after you run your program (at startup or whenever) and it is done doing what you need it to do you hide it/minimize it/put an icon in the System Tray/whatever. In your code you put the tasks you want handle when Windows shuts down in the QueryUnload event, as follows:
I hope you get what I'm saying, if not I'll be happy to elaborate.Code:Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbAppWindows Then
MsgBox "Current Windows session ending."
Cancel = True
Call YourWindowsShutRoutine
End If
End Sub