Results 1 to 6 of 6

Thread: Dos filename to regular filename

  1. #1

    Thread Starter
    Lively Member SpagettiProg's Avatar
    Join Date
    Dec 2004
    Location
    Miami, Florida
    Posts
    82

    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

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    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 .

  3. #3
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142

    Re: Dos filename to regular filename

    try this example i knocked together for you
    VB Code:
    1. Private Declare Function GetLongPathName Lib "kernel32" Alias "GetLongPathNameA" (ByVal lpszShortPath As String, ByVal lpszLongPath As System.Text.StringBuilder, ByVal cchBuffer As Int32) As Int32
    2.  
    3.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    4.         '/// your dos path here ...
    5.         Dim dospath As String = "C:\PROGRA~1\Adobe\ACROBA~1.0\Acrobat\ACROBA~3.EXE"
    6.         '/// StringBuilder to hold the received full path ...
    7.         Dim sbFile As New System.Text.StringBuilder(256)
    8.  
    9.         GetLongPathName(dospath, sbFile, sbFile.Capacity)
    10.  
    11.         MessageBox.Show(sbFile.ToString)
    12.     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]

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Re: Dos filename to regular filename

    Maybe I should update my API Guide dynamic_sysop , good to see you again .

  5. #5
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142

    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]

  6. #6

    Thread Starter
    Lively Member SpagettiProg's Avatar
    Join Date
    Dec 2004
    Location
    Miami, Florida
    Posts
    82

    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
  •  



Click Here to Expand Forum to Full Width