-
May 22nd, 2006, 04:40 PM
#1
Startup shortcut with command parameters in Visual Studio?
Hopefully someone can help me with Visual Studio. I am packaging a program and wish to have a shortcut installed on the users pc in the Startup folder, pointing to my application with a command parameter added. Any ideas how I would do this? Thanks in advance.
-
May 22nd, 2006, 04:59 PM
#2
Re: Startup shortcut with command parameters in Visual Studio?
You should be able to modify the package and deployment project provided with VB to create a custom Setup for your app.
Here is a post that shows you how to modify the P&DW project to create a desktop icon for your program (not 100% sure if that works as intended). You should be able to change the project where it creates shortcuts in the Start Menu to also create a shortcut that passes command line parameters.
-
May 22nd, 2006, 05:33 PM
#3
Re: Startup shortcut with command parameters in Visual Studio?
You can always use the API to add a new entry in the registry key - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
You just need to add a string which contains the path to your exe, and whatever command parameter(s) you want to pass.
To retrieve the command parameters, interrogate the Command$ keyword in the form_load event.
The only slight drawback to this is I am aware of at least one piece of anti-spyware software (Ad-Aware's Ad Watch) that can actively block changes to the startup section of the registry. Ad-Watch comes with Ad-Aware SE Pro (I'm not sure if you get it with the free version), and if you have it set to automatically block changes to the registry startup, no program can modify the keys or add new ones.
(\/)
(-.-)
(')(')
Bunny's quest for world domination continues.
-
May 22nd, 2006, 06:24 PM
#4
Re: Startup shortcut with command parameters in Visual Studio?
Another alternative would be to use Inno Script and Inno Setup, which can be downloaded from www.randem.com Inno Setup writes the script files that compile your app, and it's got a free trial version.
-
May 22nd, 2006, 06:32 PM
#5
Re: Startup shortcut with command parameters in Visual Studio?
Thanks, I think I will add the entry in the registry. Looks like the simplest way.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|