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\Deskto p\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
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\Deskto
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
ASKER
What I'm really after is the name of the file that was opened, so that my application can read the contents.
/Michael
/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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks everyone for your input, especially vinnyd79 as that did the trick.
/Michael
/Michael
app.path