CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: app.path

  1. #1
    Join Date
    Jan 2000
    Location
    sweden
    Posts
    22

    app.path

    Hello!!

    How to start notepad with app.path
    /peter


  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: app.path

    You can do this with the ShellExecute Windows API call :

    eg.

    In your forms declaration section :


    '
    private Declare Function ShellExecute Lib "shell32.dll" _
    Alias "ShellExecuteA" _
    (byval hwnd as Long, byval lpOperation as string, _
    byval lpFile as string, _
    byval lpParameters as string, _
    byval lpDirectory as string, _
    byval nShowCmd as Long) as Long
    '




    Now when you want to open NotePad with the path set at 'App.Path' :


    ShellExecute 0, "open", "notepad.exe", "", App.Path, 1




    You'll obviously need to change the path for the 'Notepad.exe' program (unless you have notepad.exe already in your path)


    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

  3. #3
    Join Date
    May 1999
    Posts
    3,332

    Re: app.path

    use the ShellExecute API and specify App.path as the "directory" parameter (the 5th parameter)

    or
    chdrive and chdir to app.path and use the Shell command in VB


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

Featured