Results 1 to 11 of 11

Thread: get all directories in all o/s

  1. #1

    Thread Starter
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    get all directories in all o/s

    i need help listing all diretories in
    winxp
    vista / 7/ 8

    should show all folders only thanks.

    how do i use if statement


    if windows xp then show directories

    if vista then show directories

    if win 7 then show dir

    bec folder path and names are different so i thihnk if statement is good for me but need example
    Last edited by ladoo; May 14th, 2013 at 08:09 PM.

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: get all directories in all o/s

    Do you mean all directories on a single drive or throughout the whole operating system?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: get all directories in all o/s

    I can't think of any reason that you would need to check the OS. There are differences in the directory structure from XP to Vista of course but if you are listing all directories this would not be an issue.
    If you want to use VB code then you would use the Dir$() function recursively or optionally you could use the FSO
    There are some folders that will deny access and may throw an error so you have to account for that.

  4. #4

    Thread Starter
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: get all directories in all o/s

    whole operating system , shared folder / my documents / pictures / music / windows / and system32
    i need to first list all directory , second task copy files to were ever i want

  5. #5
    Junior Member
    Join Date
    Nov 2012
    Location
    Mansfield, U.K.
    Posts
    28

    Re: get all directories in all o/s

    Command Promt..
    DIR *.* /S /AD>C:\MYDIRLIST.txt

    writes a list of all folders to a text file..

    There are ways to Manipulate the list But i forget the syntax.

    OR..
    tree /a>c:\DirTree.txt
    tree /a /f>c:\TreeWithFile.txt
    Last edited by electrodoc; May 15th, 2013 at 05:00 AM.
    There are 10 Different People In The World... Those Who Understand Binary And Those Who Don't...


  6. #6
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: get all directories in all o/s

    You can probably find the code to do what you want in the project here.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  7. #7

    Thread Starter
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: get all directories in all o/s

    it shows browse for folder , i want to show all list like tht yeh but in listbox something

  8. #8
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: get all directories in all o/s

    Against my better judgement... I'm going to allow myself to get sucked into this thread for a moment...

    what you're looking for is the Dir() function

    I'll leave it to you to figure the details.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  9. #9

    Thread Starter
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: get all directories in all o/s


  10. #10
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: get all directories in all o/s

    Sigh..... so the problem is solved ?

  11. #11
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: get all directories in all o/s

    Quote Originally Posted by ladoo View Post
    it shows browse for folder , i want to show all list like tht yeh but in listbox something
    You didn't search though the whole code.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

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