Getting a complete file list from a removable disc into VFP

Author: Joe Yoder

Posted: 2011-02-17 at 20:59:50

I want to store a copy of the complete directory structure of each optical disc in my media storage system in a VFP table memo field. I considered using recursion with adir() but concluded that it makes more sense to use something like the Windows internal command "dir" with the "/s"subdirectories option as this automatically includes file and folder sizes.

I have been experimenting with Microsoft example code which uses CreateProcess and WaitForSingleObject and can have it execute an exe such as Notepad and wait for it to be closed before returning control to VFP. When I try to execute the command "Dir" rather than "C:\Windows\System32\Notepad" I get an error. I think the difference is that 'Dir" is an internal command but maybe it is just a syntax problem.

Can someone help me out with the correct CreateProcess syntax or point me to another function?

As always - a suggestion for another approach would also be welcome.

TIA - Joe

--- StripMime Report -- processed MIME parts ---

multipart/alternative

text/plain (text body -- kept)

text/html

---

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/4d5dd2ac.26092a0a.2289.383a@mx.google.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2011 Joe Yoder