Desmond
09-26-2003, 10:15 AM
<HTML> <HEAD> <TITLE>Running an Application After Rebooting</TITLE> </HEAD> <BODY> <h3>Running an Application After Rebooting</h3> <b>Document ID: IR10015</b> <hr> The information in this article applies to: <ul> <li>AutoPlay Media Studio 5.0 Standard Edition</li> <li>AutoPlay Media Studio 5.0 Professional Edition</li> </ul> <hr> <h3>SUMMARY</h3> <p>This article describes how to run a file on the next system startup. </p> <h3>DISCUSSION</h3> <p>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:<code><pre>reboot = Application.LoadValue("Settings", "Reboot");
<br />if reboot == "" then
<br /> Shell.CreateShortcut(Shell.GetFolder(SHF_STARTUP_C OMMON), "Temporary Shortcut", "Autorun.exe", "", "", "Autorun.exe", 0, SW_SHOWNORMAL);
<br /> Application.SaveValue("Settings", "Reboot", "done");
<br />else
<br /> Shell.DeleteShortcut(Shell.GetFolder(SHF_STARTUP_C OMMON), "Temporary Shortcut");
<br /> Application.SaveValue("Settings", "Reboot", "");
<br />end</pre> </code> <br> 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. <h3>MORE INFORMATION</h3> <p>For more information please see the following topics in the AutoPlay Media Studio 4.0 help file:</p> <ul> <li><b>Program Reference | Actions | File | File.Run</b></li> </ul> <p> KEYWORDS: AutoPlay Media Studio 5.0, Actions, Open, Run, EXE, Executable </p> <hr> <FONT SIZE=1> Last reviewed: September 26, 2003<br> Copyright © 2003 <A HREF="http://www.indigorose.com" target="blank">Indigo Rose Corporation</a>. All rights reserved.<br> </FONT> </BODY> </HTML>
<br />if reboot == "" then
<br /> Shell.CreateShortcut(Shell.GetFolder(SHF_STARTUP_C OMMON), "Temporary Shortcut", "Autorun.exe", "", "", "Autorun.exe", 0, SW_SHOWNORMAL);
<br /> Application.SaveValue("Settings", "Reboot", "done");
<br />else
<br /> Shell.DeleteShortcut(Shell.GetFolder(SHF_STARTUP_C OMMON), "Temporary Shortcut");
<br /> Application.SaveValue("Settings", "Reboot", "");
<br />end</pre> </code> <br> 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. <h3>MORE INFORMATION</h3> <p>For more information please see the following topics in the AutoPlay Media Studio 4.0 help file:</p> <ul> <li><b>Program Reference | Actions | File | File.Run</b></li> </ul> <p> KEYWORDS: AutoPlay Media Studio 5.0, Actions, Open, Run, EXE, Executable </p> <hr> <FONT SIZE=1> Last reviewed: September 26, 2003<br> Copyright © 2003 <A HREF="http://www.indigorose.com" target="blank">Indigo Rose Corporation</a>. All rights reserved.<br> </FONT> </BODY> </HTML>