ODE: How to Create a Shortcut on the Desktop with ODELast reviewed: March 18, 1998Article ID: Q182606 |
The information in this article applies to:
SUMMARYAdvanced: Requires expert coding, interoperability, and multiuser skills. Microsoft Office 97 Developer Edition Tools does not provide a way to create a shortcut outside of the application's program group. This article demonstrates how to create a shortcut on the desktop using Visual Basic for Applications and batch (*.bat) files. This article assumes that you are familiar with Visual Basic for Applications, the Microsoft Office Developers Edition Setup Wizard, and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to the "Building Applications with Microsoft Access 97" manual.
MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/refguide/default.aspThis example uses or creates the following files:
Script.bat Script.bat is copied to the folder where Windows runs and is started at the end of setup. Script.bat runs Copyshortcut.mdb and waits until it has completed its work before running Cleanup.bat. CopyShortcut.mdb CopyShortcut.mdb contains code that copies a shortcut from its location in the application's program group to the computer's desktop. It also creates Cleanup.bat on the user's computer. Cleanup.bat Cleanup.bat first deletes Script.bat and CopyShortcut.mdb, which are no longer needed after the shortcut on the desktop has been created. Cleanup.bat then deletes itself.NOTE: On Microsoft Windows NT, the Command window created by Script.bat closes, while on Microsoft Windows 95 it remains open and must be closed by the user. The following steps demonstrate how to create the additional files discussed above and how to distribute them with the sample Northwind (Northwind.mdb) database using the Microsoft Office Developer Edition Tools Setup Wizard:
Creating CopyShortcut.mdb and Script.bat
Creating a Run-Time Distribution
1. Run the Microsoft Office 97 Developers Edition Tools Setup Wizard. 2. Select "Create a new set of setup options for my application's custom Setup Program", and then click Next. 3. Add the following files to the List Of Files window. Make sure to correctly set File Properties for each file you add. CopyShortcut.mdb ---------------- Destination Folder: $(WinPath) Script.bat ---------- Destination Folder: $(WinPath) Northwind.mdb ------------- Destination Folder: $(AppPath) Set As Application's Main File: Checked After you've added these files, click Next. 4. Click Add to include a shortcut to run Northwind.mdb: Shortcut for Northwind.mdb -------------------------- General Shortcut Properties Description: Northwind Database Shortcut Properties Database Command-Line Options: Run-time Click Next twice to bypass the Registry Values screen, and respond to any prompts from the Setup Wizard. 5. Make sure the following components are being included in your run-time distribution, and then click Next twice to bypass the next screen. Microsoft Access Run-Time Version Workgroup Administrator 6. Name the application Northwind, and then click Next. 7. In the "Run the following file after the custom Setup program is completed:" box, select Script.bat. 8. In "Enter or edit the command line that will be used to run the executable file," type the following: "$(FilePath)\Script.bat" 9. Select "Allow Setup to Complete Before the File Finishes Running," then click Next. 10. Follow instructions from the Setup Wizard and complete building your run-time distribution.When you run setup from either Disk 1 of your disk set or the "Net" Network/CD setup folder, a shortcut should be created on your desktop. NOTE: The process described in this article only functions during the initial setup of the application. Running setup in maintenance mode will not cause a shortcut to be created. If it is necessary to do so, you should uninstall and then reinstall the run-time application.
REFERENCESFor more information about including an executable file with your custom Setup program, search the Help Index for "Setup Wizard, files to run after Setup." Or see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q163062 TITLE : ODE97: Errors Executing File After Custom Setup |
Additional query words: icon icons
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |