Windows equivalent for the DOS command "dir > file.name"

Kyle Banerjee banerjek at ucs.orst.edu
Thu Feb 17 14:32:14 EST 2000


> Is there a mean to "capture" all the files names of a directory (and
> perhaps the date and size) and send them in a file, without having to go
> to the DOS mode.

    Yep. Just use the Windows Scripting Host. It's part of Win98. Win95
users can download it for free from http://msdn.microsoft.com/scripting/

    The bad news is that you will need a series of commands to accomplish
this task -- you'll need to use the Files property (and maybe the SubFolders
property) of the FileSystemObject. The good news is that the documentation
for the Windows Scripting Host is very good and contains examples which will
help you do what you need even if you're new to scripting.

    Windows scripts are much easier to write than DOS bat files, and the
language is much more powerful. Even though this particular example may have
been easier to do in DOS, the Windows Scripting Host is almost always a
better option. Hope this helps.

kyle
___________________________________________________________________
Kyle Banerjee     banerjek at ucs.orst.edu     Oregon State University
3769 Valley Library, Corvallis, OR 97331              (541)737-7262
              http://ucs.orst.edu/~banerjek/



More information about the Web4lib mailing list