View Full Version : Run file after rebooting
s8831533
08-01-2006, 12:55 AM
I am running a program that will run an .exe file and reboot when information is entered and OK is clicked. Once the computer has rebooted, I want the program to run another .exe file (Ping Test).
Any help is greatly appreciated.
Thanks!!!
DjArko85
08-01-2006, 07:00 PM
Hi,
I have the solution for you...
You can add the file in the startup registry.
Registry.SetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", "ArKoSoft", nomefile, REG_SZ);
System.Reboot();
-- where "ArkoSoft" is the name of the key ( you can choose a name... )
-- where "nomefile" is the file path of the file that you want run on reboot...
You must remember to delete this key because it will run every reboot if you don't delete it... But is better that you put the AMS program too in the reboot and it check ( on startup ) if the registry key does exist you must delete it and the ams program exit (and the other program it just running ).
( I'm sorry but i don't speak that good english... )
I hope you will understand... :)
If not i will try to explain again...
Alternatively, you could write you EXE to the runonce key which will run it only on the next boot up.
Registry.SetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Runo nce, "YourAppKey", filename, REG_SZ);
Darryl
08-02-2006, 11:12 AM
While the suggestions mentioned above are both valid, AMS also contains the File.RunOnReboot action that could be used.
ChrisSelnes
08-30-2007, 06:21 PM
So I created a dependency on IE 5.5 and it runs good but has two issues. First, IE always reboots so I want to rerun the CD browser once the reboot is finished but I am not sure how to include the File.RunOnReboot function in this process. I could put it in the On Shutdown but then it would write this everytime the browser is shutdown. Any suggestions?
Second, the cd browser actually starts before IE finishes the install and I don't want that. That leads to users pushing buttons before they should. How do I prevent this? Do I need to write my own dependency from scratch?
Thanks for any input.
Chris
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.