View Full Version : macro to list files?
I'm working on a macro (in wordperfect) to list the files in a directory. It works great, but ignore's sub-directories.. macro below - does anyone have any ideas on how to adjust so it'll add in subdirectories and their files as well? my guess is that the bolded line is where I'd put it.. but I don't know how list other than how I have it..
tia,
-L
macro:
vCurrentFile:=""
vStatus=""
vCurrentFile:=FileFind(Filename:"c:\temp\Patterns\*.*";Context:1)
FileNew()
While(vCurrentFile !="")
Vstatus=1
Type(vCurrentFile)
HardReturn()
vCurrentFile:=FileFind(;;1)
EndWhile
If (vStatus <>1)
MessageBox(Message:"Ain't no files there\.")
EndIf
what? no macro kings or queens out there?? :(
paulselhi
8-15-03, 11:17 PM
why does it have to be WP ? a simple dos batch file with dir/s will list all dirs and dir/s/e will list empty ones as well.. oops... you already knew that and are working on something far more involved :D
sorry don't know wp :(
it doesn't have to be WP, it's just the train of thought I started on is all <G>
problem w/going through DOS is the file names are cut off.. any ideas around that?
basically I just need a listing of all files that I can paste into notepad (well.. really textpad.. but same diff :))
drop to dos
change directory to the directory you want
dir /b/s > listing.txt
listing.txt will have the filenames (plus path). It does list the full filename, though, not the 8.3 filename. At least in XP it does, can't vouch for other O/Ses.
the > directs the output into a file called 'listing.txt'. If you don't want the pathing, you'll need to do some find/replacing, unfortuanetly. I don't know a way of doing it otherwise.
YAAAY! it works! and is SO much easier than a macro! and yup, wanted the paths (well.. the dir anyway.. find/replace of c:/temp/ replacing w/nothing will fix that).
THANK YOU!!! I just knew there had to be a way :)
You're welcome. :D Being a DOS luser sometimes has its advantages. :p
vBulletin v3.6.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.