Passing Parameters thrrough and HTML link to an .exe

How do I create an link that passes parameters to an .exe?

Pretty much I needed to give my users a link that has the password ingrained in it already.
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

David LeeConnect With a Mentor Commented:
Here's a page that describes how to format and retrieve command line parameters from a application.
David LeeCommented:
Hi, z018196.

Create a script or command file that launches the exe and passes whatever information it requires.  Link to the script/command file.
z018196Author Commented:
The only problem is that I'd need a seperate script/command-file for each user... I was hoping only to have to make a unique link.  Is there any coding I can embed in the link?
Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

David LeeCommented:
> I'd need a seperate script/command-file for each user
Perhaps, but not necessarily.  You could retrieve the username in the script and use a CASE or IF ... THEN sequence to get the right password.  Something like this:

    Set WshProcessEnvironment = WshShell.Environment("Process")
    varUsername = wshProcessEnvironment.Item("UserName")
    Select Case varUsername
        Case "Username1"
            varPassword = "PasswordA"
        Case "Username2"
            varPassword = "PasswordB"
    End Select
    Set objShell = WScript.CreateObject("WScript.Shell")
    objShell.Run "C:\Somepath\MyExecutable.exe " & varPassword
z018196Author Commented:
I don't know if that will work in my case though.  Think of it like this.  I have a database(table) with a bunch of records and each of them has a unique identifier.  I was hoping I could send out an email, when a record is created, that would have the unique Id for that record included.  When the link was pushed, a report would get generated for that record.  I can create a VB.Net app that just asks for the unique ID but I was hoping to embed it into the link so that people couldn't just enter in any number.  Does that make sense?
David LeeCommented:
Sure.  All you need to do is send a link with a parameter.  Something like
z018196Author Commented:
how to capture that parameter?  Below is my code... can you tell me what I'm missing?  I can access the application correctly, which is good, now I just need to capture the parameter.
link in email:
code in executable:
Dim str as String
Dim param as Integer
For Each str in Environment.GetCommandLineArgs()
    param = str  
I don't think the GetCommandLineAgrs() is correct.
z018196Author Commented:
I took a look at the article but couldn't find what I needed.  I can't get the GetCommandLineAgrs() to work right.  It doesn't get the parameter I pass to it, just the link to the executable.

Any suggestions?
David LeeCommented:
Please show me the link that you're using.
z018196Author Commented:
David LeeCommented:
Try this instead




Look back at that article I linked to and check the section titled "Generic Parsing Guidelines".
All Courses

From novice to tech pro — start learning today.