Jump to content
Sign in to follow this  
darkjohn20

Script on Windows Login?

Recommended Posts

darkjohn20

Hi, I noticed that there is a way in Windows to make a flash drive hold a key to unlock the computer if you cannot remember the password. This got me thinking, is there a way to run a script like this before anybody has logged on?

Just as an example, could you replicate what Windows does by looping through drives for a file, and if it is found tell the user his password?

Is there any place in the Registry that will start up a program before a log-on?

Thank you.

Edit: I am searching online and I read that it might work if made a Service?

Edited by darkjohn20

Share this post


Link to post
Share on other sites
gkrapp

Click Start - Run - gpedit.msc

This will open an Group Policy Editor for you local machine.

Take a look at Computerconfiguration* - Windows settings* - Scripts* - Startup* or Shutdown*

Here you can insert your script. It will be run with SYSTEM rights.

* = i don't know if the wording is correct cause i'm currently in front of an german windows.

Share this post


Link to post
Share on other sites
darkjohn20

What if I wanted to install my script into this list through the script (In other words, have my script add itsself here)? Is there a way to do this?

Share this post


Link to post
Share on other sites
Hawkwing

I can think of an easy way to do this (I think) but I'm not sure I would want anyone knowing how to do something like this...


The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Share this post


Link to post
Share on other sites
Jos

Its pretty strait forward:

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RUN", "MyProgram", "REG_SZ", @ScriptFullPath)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
darkjohn20

Jos, what is the difference between this and HKEY_CURRENT_USER?

Share this post


Link to post
Share on other sites
Hawkwing

I'm pretty sure that runs it after the user has logged on? Am I mistaken?


The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Share this post


Link to post
Share on other sites
Jos

Jos, what is the difference between this and HKEY_CURRENT_USER?

HKLM runs the script for all users and HKCU only for the user of this hyve.

I'm pretty sure that runs it after the user has logged on? Am I mistaken?

Correct, this will shell the script at logontime. Any needed at boot time will have to be installed as a service.

Jos ;)


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
darkjohn20

I came across this page:

http://msdn.microsoft.com/en-us/library/sd8zc8ha%28VS.80%29.aspx

Is this a good way to install a compiled exe as a service?

Share this post


Link to post
Share on other sites
darkjohn20

I'm not quite sure what you mean. I looked through the stickied FAQs (I assume that is what you meant) but could not find anything.

Share this post


Link to post
Share on other sites
Jos

I'm not quite sure what you mean. I looked through the stickied FAQs (I assume that is what you meant) but could not find anything.

Yea, looks like somebody totally screwed up that first post. Wondering why Jon did that. ;)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×