Click here to Skip to main content
15,906,625 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

How can i get a name of shortcut file of exe, which is generated from application. for example

I have the scenario as based on shortcut icon name i have to do some action in application. i have the application and i generated the exe also. Now I am creating the 3 shortcut for that exe into desktop(like My1.exe,My2.exe,My3.exe)

if i click My1.exe then i should get "My1.exe" as string (like wise...)

So based on which shortcut i clicked i am doing the further action(i.e disabling and enabling the forms or etc..)

Can anybody help me on the same...
Maciej Los 30-Dec-11 16:47pm    
Do you mean commandline arguments?

1 solution

I hope the code below will helpful to you...
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim sFileName As String = String.Empty

    sFileName = Application.ExecutablePath
    MsgBox("FullFileName: " & sFileName & vbCr & _
            "Executable name: " & IO.Path.GetFileName(sFileName) & vbCr & _
            "Path of executable: " & IO.Path.GetDirectoryName(sFileName))
End Sub

Read more about commandline arguments[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900