Results 1 to 3 of 3

Thread: How to get current directory?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    www.alexdata.com
    Posts
    484

    How to get current directory?

    I have this code...How to get current directory?

    Private Sub Command1_Click()
    Dim fso, f, f1, fc, s, folderspec
    folderspec = "c:\"
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set f = fso.GetFolder(folderspec)
    Set fc = f.Files
    For Each f1 In fc
    s = s & " " & f1.Name
    s = s & Chr(13) + Chr(10)
    Next
    Text1.Text = s
    End Sub

    If thise file was placed in c:\windows\desktop\
    how could i get it to show the current directory?

    now i have pre coded it to show C:\ but if it aint in c:\ how can i make it find the current directory ???
    ***************
    Please use [highlight=vb] ..your code.. [/highlight] when posting code!

    When you have received the working answer to your question,
    please mark it as *SOLVED* + Your Questions Title ...using your Thread's Tool menu.


    Also try to point out what answer made it work for you, or edit your first post to contain a quote of the correct answer...

    Please Answer All Questions With Working Code Examples...


    My Unfinished Projects and My working Programs
    ***************

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    VB Code:
    1. MsgBox App.Path

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    wisper, try this too: CurDir()

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