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
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 .
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
Re: Dos filename to regular filename
Maybe I should update my API Guide dynamic_sysop , good to see you again .:)
Re: Dos filename to regular filename
:wave: you too pirate mate, nice to see you got your certification :thumb:
Re: Dos filename to regular filename
You folks are the best !!
thanks