|
-
Sep 2nd, 2005, 02:20 PM
#1
Thread Starter
Lively Member
Dos filename to regular filename
In regards to the snip below, which retrieves the path of the the launching object......
Dim CommandArgs() As String = Environment.GetCommandLineArgs
FilePath = CommandArgs(1)
I can I get it to show the regular file path? I don't want the dos thingy with the ~'s here and there.
I hope I have provided enough information in my question thanks
-
Sep 2nd, 2005, 03:24 PM
#2
Sleep mode
Re: Dos filename to regular filename
If you are getting the shortpath ,then you can use this PInvoke function "GetFullPathName" that converts it to the fullpath .
-
Sep 2nd, 2005, 03:36 PM
#3
Re: Dos filename to regular filename
try this example i knocked together for you
VB Code:
Private Declare Function GetLongPathName Lib "kernel32" Alias "GetLongPathNameA" (ByVal lpszShortPath As String, ByVal lpszLongPath As System.Text.StringBuilder, ByVal cchBuffer As Int32) As Int32
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'/// your dos path here ...
Dim dospath As String = "C:\PROGRA~1\Adobe\ACROBA~1.0\Acrobat\ACROBA~3.EXE"
'/// StringBuilder to hold the received full path ...
Dim sbFile As New System.Text.StringBuilder(256)
GetLongPathName(dospath, sbFile, sbFile.Capacity)
MessageBox.Show(sbFile.ToString)
End Sub
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Sep 2nd, 2005, 03:40 PM
#4
Sleep mode
Re: Dos filename to regular filename
Maybe I should update my API Guide dynamic_sysop , good to see you again .
-
Sep 2nd, 2005, 03:44 PM
#5
Re: Dos filename to regular filename
you too pirate mate, nice to see you got your certification
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Sep 2nd, 2005, 04:55 PM
#6
Thread Starter
Lively Member
Re: Dos filename to regular filename
You folks are the best !!
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|