Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Run a program in startup before anyone log in


  • Please log in to reply
6 replies to this topic

#1 oren

oren

    Adventurer

  • Active Members
  • PipPip
  • 145 posts

Posted 07 June 2011 - 02:45 PM

How do I make my exe run at startup before anyone log in.. While still in the welcome screen.

Second. This exe will need to run a different exe also ??? So I need the option that the exe that run before log in will be able to run other exe's still before log in...


Thank you very.


EDIT : I want that when runing the exe it will have a a option to make it that the exe will run in startup before log in... I dont want to manually make it so the exe will run before startup.. I want it to be controlled by the exe itself

Edited by oren, 08 June 2011 - 02:15 PM.








#2 tip

tip

    Adventurer

  • Active Members
  • PipPip
  • 103 posts

Posted 07 June 2011 - 03:13 PM

Hi,

I'm not sure but I don't think that you can run anything (except for drivers maybe) before starting a valid session. That will be a serious security hole.

Regards
Tip

MsgBox_Tipped: Eye candy msgboxes/inputboxes/loginboxes. | CreateBlankBox: Semi-transparent layers with borders and rounded corners.


#3 MHz

MHz

    Just simple

  • MVPs
  • 5,723 posts

Posted 07 June 2011 - 03:23 PM

A startup script in group policy. Look here for some information.

#4 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 10,032 posts

Posted 07 June 2011 - 03:24 PM

If you open gpedit.msc you can specify a program/script to be run when the computer starts up, it's under "Computer Configuration/Windows Settings/Scripts/Startup". This creates a registry setting that tells the computer to run whatever you tell it to in there when it's booting up.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to an XP machine, and I'm not going to.

 

Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude

 

How to ask questions the smart way!

 

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips. Latin Square password generator

 

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.


#5 oren

oren

    Adventurer

  • Active Members
  • PipPip
  • 145 posts

Posted 08 June 2011 - 02:13 PM

A startup script in group policy. Look here for some information.



If you open gpedit.msc you can specify a program/script to be run when the computer starts up, it's under "Computer Configuration/Windows Settings/Scripts/Startup". This creates a registry setting that tells the computer to run whatever you tell it to in there when it's booting up.



Thank you but I need that my exe script will install itself.. So that it will go up before log ing, In startup.
I need to make it soo that when I give the exe to someone he will have the option that the script will run on startup before log-in (He will also have to option to remove it )

I want to make a checkbox Run with startup, So the user will be able to control it///
Is it possiable ?

Thank you.

Edited by oren, 08 June 2011 - 02:13 PM.


#6 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 10,032 posts

Posted 08 June 2011 - 02:35 PM

Have your script do a RegWrite and change the setting for "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup". First check to see what's in there already, because there might be a key called "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0" or "...\1" etc. if there are previous startup scripts running, for instance if the computer is joined to a domain and AD Group Policy sets some start up scripts. Always add your script to +1 of the ones that are already in there.

You'll need to try it on a machine to see how that gpedit changes the registry key when it adds a new script to the registry to make sure your's works the same way. I leave it to you to figure that part out. :huh2:

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to an XP machine, and I'm not going to.

 

Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude

 

How to ask questions the smart way!

 

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips. Latin Square password generator

 

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.


#7 Javik

Javik

    Wayfarer

  • Active Members
  • Pip
  • 56 posts

Posted 10 June 2011 - 04:23 AM

If this installing method is fully automated, make sure it also checks the registry run list to see if it is already in the list. If run by the system at startup with no commandline options or config file, it cannot know if it is being run for the first time by the user, or running as designed during boot..

,

Or you could simplify the code using commandline switches:

MyProgram.exe (No options) --> Run for first time by user, install mode
MyProgram.exe /run --> Startup method used in the GPO / registry, after installed
MyProgram.exe /remove --> Removal function to take out of GPO / registry




5 user(s) are reading this topic

0 members, 5 guests, 0 anonymous users