How to run program as administrator at startup.

D

Dave \Crash\ Dummy

I have a program that I want to run at startup, but it must be run as
administrator to work. Any ideas on how to accomplish this?
 
R

Rob

I have a program that I want to run at startup, but it must be run as
administrator to work. Any ideas on how to accomplish this?
Using the task scheduler should work.
 
R

R. C. White

Hi, Crash.

Does this do what you want:

Right-click on the program's .exe (or in the Start menu)
Click Properties
On the Compatibility tab, check the box (at the bottom) that says, "Run this
program as an Administrator".



"Dave "Crash" Dummy" wrote in message
I have a program that I want to run at startup, but it must be run as
administrator to work. Any ideas on how to accomplish this?
 
D

Dave \Crash\ Dummy

R. C. White said:
Hi, Crash.

Does this do what you want:

Right-click on the program's .exe (or in the Start menu) Click
Properties On the Compatibility tab, check the box (at the bottom)
that says, "Run this program as an Administrator".
Unfortunately, no. That works fine if I execute the program after
Windows starts, but not if I put it in the Startup folder. I am able to
do what I want using the Task Scheduler, though.
 
G

Gene E. Bloch

Unfortunately, no. That works fine if I execute the program after
Windows starts, but not if I put it in the Startup folder. I am able to
do what I want using the Task Scheduler, though.
I have seen cases where I can't tell the shortcut in the start menu to
run as administrator, but if I go to the .exe file I can. I consider
that a bit weird :)

Anyway, possibly you ran int that (or not).
 
D

Dave \Crash\ Dummy

Gene said:
I have seen cases where I can't tell the shortcut in the start menu
to run as administrator, but if I go to the .exe file I can. I
consider that a bit weird :)

Anyway, possibly you ran int that (or not).
Nawp. I tried it with two programs, and they both ran as administrator
either directly or from the shortcut, but neither ran at startup in the
Startup folder. I figure those must execute before anybody is logged on.

For the record, what I want to do is start the W32Time service at
startup. It is no longer a problem because I wrote a scheduled task to
do it. I'm just exploring options, like starting a third party time sync
utility (abouttime.exe).
 
G

Gene E. Bloch

Nawp. I tried it with two programs, and they both ran as administrator
either directly or from the shortcut, but neither ran at startup in the
Startup folder. I figure those must execute before anybody is logged on.

For the record, what I want to do is start the W32Time service at
startup. It is no longer a problem because I wrote a scheduled task to
do it. I'm just exploring options, like starting a third party time sync
utility (abouttime.exe).
That seems a good approach.

A bit OT: I vaguely remember people describing a way to get a program to
run as Administrator without being bothered by UAC. You put it in the
Task Scheduler with "highest privileges" and then run it from inside the
scheduler. That seems pretty awkward, so it must've been needed to solve
some problem that I no longer recall.
 
D

Dave \Crash\ Dummy

Gene said:
That seems a good approach.

A bit OT: I vaguely remember people describing a way to get a program to
run as Administrator without being bothered by UAC. You put it in the
Task Scheduler with "highest privileges" and then run it from inside the
scheduler. That seems pretty awkward, so it must've been needed to solve
some problem that I no longer recall.
I spend way too much time figuring out how to get around Windows
features. :)
 
C

Char Jackson

For the record, what I want to do is start the W32Time service at
startup. It is no longer a problem because I wrote a scheduled task to
do it. I'm just exploring options, like starting a third party time sync
utility (abouttime.exe).
In the case of W32Time, since it's a standard Windows service, would
you be able to accomplish the task by adjusting its properties in
Services.msc?

Of course, that probably wouldn't help with your third party utility.
 
D

Dave \Crash\ Dummy

Char said:
In the case of W32Time, since it's a standard Windows service, would
you be able to accomplish the task by adjusting its properties in
Services.msc?
No. That's what I tried first. Setting the start to "automatic" doesn't
start it.
 
C

Char Jackson

No. That's what I tried first. Setting the start to "automatic" doesn't
start it.
Good to know, thanks. I think your solution (using Task Scheduler) is
about as simple as it gets, even better perhaps than writing a script
with either the 'sc' command or the 'net start' command.
 
D

Dave \Crash\ Dummy

Char said:
Good to know, thanks. I think your solution (using Task Scheduler) is
about as simple as it gets, even better perhaps than writing a
script with either the 'sc' command or the 'net start' command.
A script has the same problem as a shortcut. It needs to be run as
administrator during startup, before logon.
 
J

Joe Morris

Dave "Crash" Dummy said:
I have a program that I want to run at startup, but it must be run as
administrator to work. Any ideas on how to accomplish this?
You don't say what flavor of win7 you've got...but if it's a business-class
version (Pro/Ultimate/Enterprise) have you considered setting the script up
to execute as a startup script through GPEDIT or as a domain GPO? For
GPEDIT.MSC, navigate to:

Local Computer Policy
Computer Configuration
Windows Settings
Scripts (Startup/Shutdown)

and point the policy to wherever you've stashed the script, which will run
at startup time in SYSTEM context. It will not have access to the desktop
(which hasn't been created when the script runs) so you'll probably want to
redirect any error messages that might be generated to a file somewhere.

Note the difference between a startup and a login script: the startup script
runs at Windows initialization and in SYSTEM context; the login script runs
at login time (do'h!) and in the context of the user being logged in...and,
more to the point of your query, the login script requires UAC consent for
elevation.

One possible gotcha for you: you may find that the startup script runs
before services your script requires (e.g., Windows Update, which is
required for some installations even if they are entirely local) have
completely initialized. That's not necessarily the case but it's something
to keep in mind if things don't work the way you expect.

Joe Morris
 
C

Carroll Robbins

21:05:16 -0400 in said:
No. That's what I tried first. Setting the start to "automatic" doesn't
start it.
Set the start to "automatic (delayed start)".
 
D

Dave \Crash\ Dummy

Carroll said:
Set the start to "automatic (delayed start)".
Been there, done that. I tried both "automatic" and "automatic (delayed
start)" without success.
 
D

Dave \Crash\ Dummy

Joe said:
You don't say what flavor of win7 you've got...but if it's a
business-class version (Pro/Ultimate/Enterprise) have you considered
setting the script up to execute as a startup script through GPEDIT
or as a domain GPO? For GPEDIT.MSC, navigate to:

Local Computer Policy
Computer Configuration
Windows Settings
Scripts (Startup/Shutdown)

and point the policy to wherever you've stashed the script, which
will run at startup time in SYSTEM context. It will not have access
to the desktop (which hasn't been created when the script runs) so
you'll probably want to redirect any error messages that might be
generated to a file somewhere.

Note the difference between a startup and a login script: the startup
script runs at Windows initialization and in SYSTEM context; the
login script runs at login time (do'h!) and in the context of the
user being logged in...and, more to the point of your query, the
login script requires UAC consent for elevation.

One possible gotcha for you: you may find that the startup script
runs before services your script requires (e.g., Windows Update,
which is required for some installations even if they are entirely
local) have completely initialized. That's not necessarily the case
but it's something to keep in mind if things don't work the way you
expect.
I am running Windows 7 Ultimate x64. I was able to successfully run a
script to start the time service using the Group Policy Editor. The bad
news is that the Group Policy Management Console is not installed (and
not available). There is no listing in the "Administrative Tools" menu
for "Local Computer Policy." I had to create a shortcut an add it
myself. There are no sample scripts available. Fortunately, I am
familiar with VBScript, and the script I constructed worked.
 
J

Joe Morris

Dave "Crash" Dummy said:
Joe said:
Dave "Crash" Dummy said:
I have a program that I want to run at startup, but it must be run
as administrator to work. Any ideas on how to accomplish this?
[recommendation to use GPEDIT to have the system invoke a startup
scripts]
I am running Windows 7 Ultimate x64. I was able to successfully run a
script to start the time service using the Group Policy Editor. The bad
news is that the Group Policy Management Console is not installed (and not
available).
I don't see how that could be the case for a normal system. I work mostly
with Enterprise, but after seeing your comment I did a fast build of
Ultimate 64 and invoking "GPEDIT.MSC" (orb -> type GPEDIT.MSC -> press
ENTER) opens up the group policy editor without any problems. The path in
the left pane of the editor that I gave upthread:

Local Computer Policy
Computer Configuration
Windows Settings
Scripts (Startup/Shutdown)

leads to the option to specify which script(s) are to be run at startup.
There is no listing in the "Administrative Tools" menu
for "Local Computer Policy." I had to create a shortcut an add it myself.
There are no sample scripts available. Fortunately, I am familiar with
VBScript, and the script I constructed worked.
That sounds like you're looking in the START menu; what is there if you
enable the administrative tools display is a link to a different policy
editor. Just invoke GPEDIT.MSC (or, if you prefer, run MMC and load the
snap-in named "Group Policy Object Editor"...same result other than a
slightly different set of menu items).

Joe
 
D

Dave \Crash\ Dummy

Joe said:
Dave "Crash" Dummy said:
Joe said:
I have a program that I want to run at startup, but it must be run
as administrator to work. Any ideas on how to accomplish this?
[recommendation to use GPEDIT to have the system invoke a startup
scripts]
I am running Windows 7 Ultimate x64. I was able to successfully run a
script to start the time service using the Group Policy Editor. The bad
news is that the Group Policy Management Console is not installed (and not
available).
I don't see how that could be the case for a normal system. I work mostly
with Enterprise, but after seeing your comment I did a fast build of
Ultimate 64 and invoking "GPEDIT.MSC" (orb -> type GPEDIT.MSC -> press
ENTER) opens up the group policy editor without any problems. The path in
the left pane of the editor that I gave upthread:

Local Computer Policy
Computer Configuration
Windows Settings
Scripts (Startup/Shutdown)

leads to the option to specify which script(s) are to be run at startup.
There is no listing in the "Administrative Tools" menu
for "Local Computer Policy." I had to create a shortcut an add it myself.
There are no sample scripts available. Fortunately, I am familiar with
VBScript, and the script I constructed worked.
That sounds like you're looking in the START menu; what is there if you
enable the administrative tools display is a link to a different policy
editor. Just invoke GPEDIT.MSC (or, if you prefer, run MMC and load the
snap-in named "Group Policy Object Editor"...same result other than a
slightly different set of menu items).
That's what I did. I must have misunderstood. I was looking for "Group
Policy"
or "Local Computer Policy" on the Start menu or the Control Panel by
default.
BTW, it can be added to the Control Panel with a registry tweak:
http://www.sevenforums.com/tutorials/656-control-panel-add-local-group-policy-editor.html
 

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