Automatically starting a program without logging into an account

Y

Yousuf Khan

I need to startup a couple of programs automatically at Windows startup,
even before users login to their accounts. The way I've got it setup
now, I have created a special account for these two programs, which get
started in its startup folder, and I have set it so that this account is
the first one to auto-login at system startup. I've then set its screen
saver to kick in after one minute, and so it automatically switches out
and brings you back to the login screen.

I can't help but wonder if there isn't a more elegant way to do this,
without requiring a full user account to be setup and started just to
run these two programs which will then sit idly in the background
waiting for an event to happen.

I looked at maybe running this through Windows 7's Task Scheduler. I
looked at creating a task with the "Run whether user is logged on or
not" setting, but it doesn't seem to run unless you login to that
account at least once.

So any other solutions?

Yousuf Khan
 
A

Andrew

Yousuf Khan said:
I need to startup a couple of programs automatically at Windows startup,
even before users login to their accounts. The way I've got it setup now,
I have created a special account for these two programs, which get started
in its startup folder, and I have set it so that this account is the first
one to auto-login at system startup. I've then set its screen saver to
kick in after one minute, and so it automatically switches out and brings
you back to the login screen.

I can't help but wonder if there isn't a more elegant way to do this,
without requiring a full user account to be setup and started just to run
these two programs which will then sit idly in the background waiting for
an event to happen.

I looked at maybe running this through Windows 7's Task Scheduler. I
looked at creating a task with the "Run whether user is logged on or not"
setting, but it doesn't seem to run unless you login to that account at
least once.

So any other solutions?

Yousuf Khan
Create a service for the apps, and set it to autostart.

programatically -
http://msdn.microsoft.com/en-us/library/9k985bc9(VS.80).aspx

through the command line - http://www.tacktech.com/display.cfm?ttid=197
 
D

Dave-UK

Yousuf Khan said:
I need to startup a couple of programs automatically at Windows startup,
even before users login to their accounts. The way I've got it setup
now, I have created a special account for these two programs, which get
started in its startup folder, and I have set it so that this account is
the first one to auto-login at system startup. I've then set its screen
saver to kick in after one minute, and so it automatically switches out
and brings you back to the login screen.

I can't help but wonder if there isn't a more elegant way to do this,
without requiring a full user account to be setup and started just to
run these two programs which will then sit idly in the background
waiting for an event to happen.

I looked at maybe running this through Windows 7's Task Scheduler. I
looked at creating a task with the "Run whether user is logged on or
not" setting, but it doesn't seem to run unless you login to that
account at least once.

So any other solutions?

Yousuf Khan
Try running the task from the System account.
On the General tab > Security options > Change user or group,
Change to 'System'.
 
G

Gene E. Bloch

I need to startup a couple of programs automatically at Windows startup,
even before users login to their accounts. The way I've got it setup
now, I have created a special account for these two programs, which get
started in its startup folder, and I have set it so that this account is
the first one to auto-login at system startup. I've then set its screen
saver to kick in after one minute, and so it automatically switches out
and brings you back to the login screen.

I can't help but wonder if there isn't a more elegant way to do this,
without requiring a full user account to be setup and started just to
run these two programs which will then sit idly in the background
waiting for an event to happen.

I looked at maybe running this through Windows 7's Task Scheduler. I
looked at creating a task with the "Run whether user is logged on or
not" setting, but it doesn't seem to run unless you login to that
account at least once.

So any other solutions?

Yousuf Khan
You could try putting a command in one of these:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run

I have no idea when that stuff gets executed, but I think it's worth an
experiment.
 
S

Seth

Gene E. Bloch said:
You could try putting a command in one of these:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run

I have no idea when that stuff gets executed, but I think it's worth an
experiment.

The first 2 don't run until someone is logged in (think of them as an
alternative to the StartUp folder).

The 3rd never runs as that hive is only a template to be used when a user
who doesn't have a profile on that machine logs in for the first time.
 
G

Gene E. Bloch

The first 2 don't run until someone is logged in (think of them as an
alternative to the StartUp folder).
As I did...which is why I proposed them.
The 3rd never runs as that hive is only a template to be used when a user
who doesn't have a profile on that machine logs in for the first time.
I wondered what that was for :)
 
S

Seth

Gene E. Bloch said:
As I did...which is why I proposed them.
Right, which won't work for the OP cause he was looking for the things to
run WITHOUT a user being logged in...
 
Z

Zaphod Beeblebrox

Gene E. Bloch said:
As I did...which is why I proposed them.


I wondered what that was for :)
Actually, that is the profile for the Local System account. The
profile used to create new users is in c:\Users\Default\NTUser.Dat in
Vista / Win7, C:\Documents and Settings\Default User\ntuser.dat in XP.
See http://blogs.msdn.com/oldnewthing/archive/2007/03/02/1786493.aspx
(among others).

--
Zaphod

Pan-Galactic Gargle Blaster: A cocktail based on Janx Spirit.
The effect of one is like having your brain smashed out
by a slice of lemon wrapped round a large gold brick.
 
D

Dave-UK

Seth said:
Right, which won't work for the OP cause he was looking for the things to run WITHOUT a user being
logged in...
As Yousuf Khan hasn't bothered to give us any feedback I decided to
see if the task method would work and it seems it does.
As I normally only have one account I created a couple of test accounts
and created a task to run the Calculator on every start up using the System
account. When I rebooted, any account that I logged on to had calc.exe running
in the background in Task Manager (but not visible on the Desktop).
 
A

Andrew

Gene E. Bloch said:
I guess I shouldn't have accepted Seth's wisdom, then :)
I am curious why you guys see this as better than creating a service?
 
S

Seth

Gene E. Bloch said:
I guess I shouldn't have accepted Seth's wisdom, then :)

I was right about the first 2 keys but learned something new about the
third.
 
S

Seth

Andrew said:
I am curious why you guys see this as better than creating a service?

Making something run as a service is a little trickier. There is a "hack" of
sorts that MS provides to run an executable as a service but as stated, it's
more of a hack then an actual service. This method lets the application in
question run as it intended, in a user workspace but apparently without
requiring a "real user" to log on.
 
Z

Zaidy036

In Win 7 (at least my 64 bit) Task Scheduler provides an option to run on Start
Up.
 
G

Gene E. Bloch

I am curious why you guys see this as better than creating a service?
If you read my post, you'll see that in the first place I was unsure of how
useful my suggestion was, and I know even less about services. I just was
proposing an idea for the OP to try.

In his situation, I would have tried what I suggested, and if it didn't
work well for me, I would have looked for another idea. I do that sort of
trial and error thing frequently.
 
G

Gene E. Bloch

I was right about the first 2 keys but learned something new about the
third.
Then I win, because I seemed to have learned three new things (two, I
mean), since I was wrong about all three :)

Please don't ignore the smiley!
 
S

Seth

Gene E. Bloch said:
Then I win, because I seemed to have learned three new things (two, I
mean), since I was wrong about all three :)

Please don't ignore the smiley!

Never ignore the smiley!
 
Z

Zaphod Beeblebrox

Seth said:
I was right about the first 2 keys but learned something new about
the third.
Learning is good, which is why I pointed it out - that, and I was
wrong about it for so long myself that I almost feel responsible to
spreading misinformation if I don't :). Of course, had MS give that
profile a more logical name it wouldn't be such a common
misconception.
 
Y

Yousuf Khan

Zaidy036 said:
In Win 7 (at least my 64 bit) Task Scheduler provides an option to run on Start
Up.
But as mentioned by me earlier, that only runs when the user account it
was created for is run for the first time. If you don't login, then it
won't ever get run.

Yousuf Khan
 
Y

Yousuf Khan

Andrew said:
I am curious why you guys see this as better than creating a service?
To tell you the truth, your suggestion seems the scariest of all to try
first. It might be the solution if the other other solutions don't work
at all.

Yousuf Khan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top