Visual Basic Application Shortcut Parameters

argowen

New member
Local time
Today, 09:02
Joined
Nov 28, 2008
Messages
7
I am fairing competent at using Visual Basic however this one thing has just come to me which I would like to utilise for a project and would like input if someone else has achieved this.

Basically I would like to write my application and once it has been compiled etc and being used by a user they would be able to create a shortcut to it for example:

c:\randomprogram.exe +developer 1

And once the application opens the variable I am guessing it will be i.e. developer would be assigned the value 1 so that I can of course display developer related stuff. It's not something that I've tried before and I was just wondering is it litterally a case of defining the variable developer as

dim Developer as integer

and then once the application as been opened with the +developer 1 parameter the value would already be initiated to 1. I'm currently not at my pc that has VB on to test this idea but I thought I'd ask so that if anybody already knows they can correct me if I am wrong. Also when I do get to test I will be able to update you all for future reference. IF I CAN ACTUALLY GET IT TO WORK LOL.

Cheers,
Tim
 
Yes, you can do that. There is a spot under PROJECT > PROJECTNAME PROPERTIES > MAKE where you can name a command line variable. Then you can, in your code use that. When you pass that variable using a shortcut or command in a command window it will pass that in and you can use it.
 

Users who are viewing this thread

Back
Top Bottom