Install program at startup

J

Joe Topjian

Hello -

I have an MSI that I'd like to have installed during startup

I know I can use a Local or Group policy and just specify the program
under Computer Startup (rather than User Logon) or even use Software
Distribution, but is there any other way -- specifically without using
a Policy?

Thanks
-Joe
 
W

Wesley Vogel

Add a String Value (REG_SZ) here...

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\
CurrentVersion\RunOnce

Value Name can be anything. Value Data should be the path to the file. For
example,
C:\Program Files\MRU-Blaster\indexcleaner.exe

Will run once and the key will be deleted.

By default, Run keys are ignored in Safe mode. The value name can be
prefixed with an exclamation point to defer deletion of the value until
after the command has been completed. The value is deleted before the
command line is run unless overridden as noted above. As a result, if a
RunOnce operation fails to run properly, the component that failed will not
be asked to run again the next time you start the computer.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
J

Joe Topjian

Thanks for your reply. Will the HKLM\RunOnce run as a local admin? I
tried this earlier. When I logged in with an admin account, the
program installed OK, but when I used an unprivileged account, the
program did not install.

Thanks
-Joe
 
W

Wesley Vogel

The registry key will try to run the app, as far as if it will actually run
on an unprivileged account, I have no idea. Maybe not. anything in the
HKEY_LOCAL_MACHINE key should run regardless of who is logged on. You'll
have to try it and see.

Limited account Cannot install software or hardware, but can access
programs that have already been installed on the computer.

Guest account Cannot install software or hardware, but can access programs
that have already been installed on the computer.

You can try this.

Use the runas command to start programs as an administrator.
See: To create a shortcut using the runas command.
Paste the following line into Start | Run and click OK...

hh localsec.chm::/windows_security_runas_shortcut.htm

Create a shortcut and use that shortcut for the runonce key.

This may be geting more complicated than it needs to be.

Always install with elevated privileges
User
http://www.boyce.us/gp/gpcontent.asp?ID=680
System
http://www.boyce.us/gp/gpcontent.asp?ID=314

Note, If you add a startup script in Group Policy it ends up here...
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\
CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0\0
and here...
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\
System\Scripts\Startup\0\0

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 

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