Question Locked

Trying to read target info from shortcut to vb.net 2005 app

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Ok here is my problem I once had a program that was written in VB6 and what it did was when you ran a shortcut to this app it would launch the app and read the target info from the shortcut and update an app based on that info. example

target: "c:\test\updater.exe c:\app.exe"

and what this would do is run Updater then it would look at C:\app.exe and copy it to the temp drive.

i am trying to figure out how to read the target info from the shortcut with vb.NET 2005. I can do everthing else with ease but trying to read the target info is just not working. PLEASE HELP.

3 replies

by tony hopkinson

string[] args = Environment.GetCommandLineArgs();
in from C# ,.net. Should be thereabouts for VB.

args[1] should be the first one for updateer.exe.

Don't foprget to test upperbound(0) on args to make sure it was called with one.

by cwarley

Well just like nomal I work on something all day and finally decide to ask for help and as soon as I ask for help I fugure it out. But the reply from hopkins was very helpfull thankyou for trying. here is what I did

Dim f() As String = System.Environment.GetCommandLineArgs

Dim cmdstr As String = f(1).ToLower

This discussion is closed to new replies.