Results 1 to 5 of 5

Thread: "dir /s > files.txt" without shell, but API

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Posts
    26

    Angry

    I could proubly solve this myself if my stupid school computers running NT could do anything right and not crash when I open the VB help, but alas we live in an imperfect world.

    Anyway, here is my question:

    I wanna make a text file that lists all the subdirectories and files from the root of C. Using shell it would be simple: "dir /s > files.txt". But I want to do this without using Shell. It doesn't have to be with API either if it can be done with regular VB functions.

    The only reason I don't want to use Shell is because I'm unsure if it will work on WinME. I've been told they got rid of DOS for some stupid reason.

    Thanks

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    DOS is still there in WinME -- it has to be It's just hidden, that's all.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    New Member
    Join Date
    Apr 2001
    Posts
    14
    Yes, MS-DOS still exists. The difference is that when you start up the computer, it doesn't start up in DOS first. It directly goes to loading Windows - making the loading time significantly faster. You can still do boot disks and the like. There's really no disadvantage that I can see with my WinME machine.

    Anyway, to your question. As long as you realize that you must create a .bat file with the dir command to be executed, then you'll be fine in any windows os.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Posts
    26
    So shelling will work in WinME? sounds good. Now what about what you said about making a .bat file. Why must I do that exactly?

  5. #5
    New Member
    Join Date
    Apr 2001
    Posts
    14
    Because (and corrent me if I'm wrong, or show me a method where you don't have to use the .bat) using the shell command like this doesn't work:

    Shell "dir C:\ /s > C:\file.txt"

    It will give you the error that the file "dir" does not exist. I've also experimented with doing:

    Shell "Command.com dir C:\ /s > C:\file.txt"

    But with no success.

    So a work-around is to save the command to a .bat file, execute it, and then you'll have your results.

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