Solved

DIR /S for Visual Basic?

Posted on 1998-08-17
1
215 Views
Last Modified: 2013-11-25
I have a function that I wish to perform on every file on my hard drive.  I have the function working but for only one file selection at a time.
More detail...I would like to scan all the files on any hard drive I select and  evaluate each filename and path and if filename is of a certain extension, concatenate certain characters of the filename and path into a string which I would like to send to a ascii database file.  Therefore, if 325 files meet the criteria, the database would have 325 strings separated by a space with the concatenated string segments ie
   34123456   c:\r34\123456.drw
   51213141   d:\hello\f51\213141.drw
   82135455   f:\stuff\goodstuf\x82\135455.drw
0
Comment
Question by:JACKO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 12

Accepted Solution

by:
mark2150 earned 50 total points
ID: 1429476
Good old DOS SHELL command:

ext = ".XXX"     ' Set to desired extension
SHELL( "C:\COMMAND.COM DIR C:\*." & ext & " /s /b /-p > ASCII.TXT", 1)

When this command completes you'll have a vanilla ASCII file, ASCII.TXT with the file names and paths.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Suggested Courses
Course of the Month7 days, 20 hours left to enroll

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question