Run your application on Startup

Use this board to post your code snippets - tips and tricks
18 posts Page 2 of 2
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1892
Joined: Wed Dec 16, 2009 9:56 pm

my windows 7 alerts me a registry changes
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Re: Run your application on Startup
Lewis
Well Zachman thats what it is doingm changing registery to make it startup strait away.
Image
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1892
Joined: Wed Dec 16, 2009 9:56 pm

i know im just commenting on what he said before me
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Re: Run your application on Startup
Lewis
ohh lol, im sorry.
Image
User avatar
un kn0 wn
VIP - Donator
VIP - Donator
Posts: 269
Joined: Mon Mar 29, 2010 6:12 pm

Thx for this lil snip cuz i can use this for software installer and uninstaller.
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

CodenStuff or anyone:
I have a settings window with a checkbox saying Run at startup and by default it is unchecked. If the user doesn't have the key in his registry and it attempts to remove the key, will it throw an error? Because I don't want an error saying something like:
"Registry key does not exist."
I especially don't want it to screw up there registry. So please help?
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Re: Run your application on Startup
Lewis
I think it will error because it is removing something that isnt there but check if it is there somehow? Also it wouldnt bugger the registry up :D
Image
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4390
Joined: Tue Aug 04, 2009 1:47 am

Hello Reboh,

Quick solution is to just put the delete code into a try...catch event like:
Code: Select all
Try
'Delete registry code here
Catch ex As Exception
End Try
That way if it doesnt exist it wont do anything or show an error.
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
18 posts Page 2 of 2
Return to “Quick Snips”