Running an Application After Rebooting
Document ID: IR10015The information in this article applies to:
- AutoPlay Media Studio 5.0 Standard Edition
- AutoPlay Media Studio 5.0 Professional Edition
SUMMARY
This article describes how to run a file on the next system startup.
DISCUSSION
As an example, we will create an application with two buttons: Install Acrobat, and Install Application101. The Acrobat install program will require the user to restart their computer once the install completes. To ensure that the application is launched when the user reboots their system, add the following code to the On Click event of the Install Acrobat button:reboot = Application.LoadValue("Settings", "Reboot");
if reboot == "" then
Shell.CreateShortcut(Shell.GetFolder(SHF_STARTUP_C OMMON), "Temporary Shortcut", "Autorun.exe", "", "", "Autorun.exe", 0, SW_SHOWNORMAL);
Application.SaveValue("Settings", "Reboot", "done");
else
Shell.DeleteShortcut(Shell.GetFolder(SHF_STARTUP_C OMMON), "Temporary Shortcut");
Application.SaveValue("Settings", "Reboot", "");
end
Please note that this script adds a temporary shortcut to the Windows startup folder. When your application is deleted on reboot, the temporary shortcut is deleted.
MORE INFORMATION
For more information please see the following topics in the AutoPlay Media Studio 4.0 help file:
- Program Reference | Actions | File | File.Run
KEYWORDS: AutoPlay Media Studio 5.0, Actions, Open, Run, EXE, Executable
Last reviewed: September 26, 2003
Copyright © 2003 Indigo Rose Corporation. All rights reserved.