Create a new project and Add the following code.
Private Sub Form_Load()
If Command <> "" Then
retFile = Replace(Command, Chr(34), "")
MsgBox retFile
Next
End Sub
If Command <> "" Then
retFile = Replace(Command, Chr(34), "")
MsgBox retFile
Next
End Sub
In the above code, the command property gives our application the commands that have been passed on it through other apps. When a file is opened with our app then the command returns the filename in double quotes ex - "D:/a.mp3". We first check to see if any command has been passed to the app. if yes then we replace the double quotes with vb Null string and display it in a message box. Simple as that.