[C++/CLI and C++] Run before winlogin

How do I run a program before you login? I think you have to put it in the registry. It's nothing illegal. I thought of making like a prank pop-up message box or something to mess with my dad.
Are you thinking about the Run key which starts apps like Messenger?

Run and RunOnce Registry Keys
http://msdn.microsoft.com/en-us/library/aa376977(v=vs.85).aspx

But these run immediately after a user logs in, and just before they get control of the desktop.

Run is used to run an app every time you log in. RunOnce is similar, but lives up to its name.

Andy

P.S. Also a useful place to check if you think you're been infected by a trojan!
Last edited on
You may also consider using "Task Scheduler".

http://msdn.microsoft.com/en-us/library/aa383614.aspx
probably you can do it with create new value in your "run" key in your regedit. and i guess a program is always run after user login and not before it...
- Services can run before a user logs in.

- Any GPO's (Group Policy Objects) applied to a Machine are executed before the user logs in.

- Task Scheduler is a valid option as vince1027 pointed out.

It used to be pretty popular to steal a users credentials by spoofing the login screen and just having the user hand you the data, this is why Windows requires you to press Ctrl + Alt + Del before logging in. There have been a bunch of precautions put in place to prevent this kind of thing and it would stop your prank at this point.

Can we help you rethink the prank? I like this type of mischief and I'm kind of interested to see what we can do.
Thanks. I need it to run with the login thing, before anything the user gains control of the desktop. I want to say something like, "We're sorry, but your account has been deleted", and that's it. Something like a simple messgebox, but I just need to know how to get it to run before the user can login to an account. I know that it's possible using the registry, but I don't know the value that I need to set it for. I'll look at those link that you sent me though.
Sorry, for taking so long. I've been busy, I just started highschool.
Topic archived. No new replies allowed.