Link to home
Start Free TrialLog in
Avatar of gem56
gem56

asked on

Problems with command line arguments

Hi guys,
I'm having problems with command line arguments. When I double click on a file (p1.gemr) on my Desktop, my application uses the following statement to read the command line parameters, wanting to extract the above file name:

     sFileName = Replace(Command, """", "")

Instead of getting a proper file path+name I get what appears to be a truncated name, e.g.

     C:\DOCUME~1\michael\Desktop\P165E9~1.GEM

I imaging it has something to do with short file names but I don't know how to check/set that.
Does anyone have any ideas as to how to solve my problem?

/Michael
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

to get the application path, use
app.path
Avatar of gem56
gem56

ASKER

What I'm really after is the name of the file that was opened, so that my application can read the contents.

/Michael
have you tried opening it using exactly what was returned.  i.e., even though we don't know what "DOCUME~1" really refers to, it should still be a valid path.  Unfortunately I don't have a system I can test this on, so it's just a guess.

ASKER CERTIFIED SOLUTION
Avatar of vinnyd79
vinnyd79

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gem56

ASKER

Thanks everyone for your input, especially vinnyd79 as that did the trick.

/Michael