Click here to Skip to main content
15,891,652 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Get all directories and subdirectories Pin
Colin Angus Mackay25-Jan-04 13:26
Colin Angus Mackay25-Jan-04 13:26 
GeneralRe: Get all directories and subdirectories Pin
ltt1925-Jan-04 13:41
ltt1925-Jan-04 13:41 
GeneralRe: Get all directories and subdirectories Pin
Colin Angus Mackay25-Jan-04 21:28
Colin Angus Mackay25-Jan-04 21:28 
GeneralRe: Get all directories and subdirectories Pin
ltt1926-Jan-04 4:05
ltt1926-Jan-04 4:05 
GeneralRe: Get all directories and subdirectories Pin
Colin Angus Mackay26-Jan-04 10:14
Colin Angus Mackay26-Jan-04 10:14 
GeneralRe: Get all directories and subdirectories Pin
-Dr_X-25-Jan-04 14:28
-Dr_X-25-Jan-04 14:28 
GeneralRe: Get all directories and subdirectories Pin
ltt1926-Jan-04 4:08
ltt1926-Jan-04 4:08 
GeneralRe: Get all directories and subdirectories Pin
-Dr_X-26-Jan-04 4:34
-Dr_X-26-Jan-04 4:34 
Here is something I wrote a few years back in VB6 to simple create a text file of all of my MP3s. It doesn't filter them by *.MP3 since that is all that is in that particular shared drive but you get the idea. I haven't had to mess around with the system.io yet. But the below does work. Give it a try.

Dim fso As New FileSystemObject
Dim List As TextStream

Const C_PLUS As String = "+ "
Dim i As Integer ' Indent

Private Sub Main()
Dim d As Folder

  Set d = fso.GetFolder("N:\")
  Set List = fso.CreateTextFile(d.Path & "NewSongList.txt", True)

  DoFolders d
  List.Close
  
End Sub

Private Sub DoFolders(fldr As Folder)
Dim d As Folder
  If i = 0 Then
    List.WriteLine Space(i) & C_PLUS & fldr.Path
  Else
    List.WriteLine Space(i) & C_PLUS & fldr.Name
  End If
  i = i + 2
  DoFiles fldr
  For Each d In fldr.SubFolders
    DoFolders d
  Next
  i = i - 2
End Sub

Private Sub DoFiles(fldr As Folder)
Dim f As File

  For Each f In fldr.Files
    List.WriteLine Space(i + 2) & f.Name
  Next
End Sub


Michael
GeneralRe: Get all directories and subdirectories Pin
ltt1926-Jan-04 5:32
ltt1926-Jan-04 5:32 
GeneralRe: Get all directories and subdirectories Pin
Jim Taylor25-Jan-04 23:21
Jim Taylor25-Jan-04 23:21 
GeneralRe: Get all directories and subdirectories Pin
ltt1926-Jan-04 4:11
ltt1926-Jan-04 4:11 
GeneralI got it! Pin
ltt1926-Jan-04 13:36
ltt1926-Jan-04 13:36 
GeneralThread Pin
Anonymous25-Jan-04 11:41
Anonymous25-Jan-04 11:41 
GeneralRe: Thread Pin
Anonymous25-Jan-04 11:42
Anonymous25-Jan-04 11:42 
GeneralRe: Thread Pin
Colin Angus Mackay25-Jan-04 13:34
Colin Angus Mackay25-Jan-04 13:34 
GeneralNewbie question Pin
Anonymous25-Jan-04 5:57
Anonymous25-Jan-04 5:57 
GeneralBackgroundimage of Treeview Pin
Member 84000225-Jan-04 2:12
Member 84000225-Jan-04 2:12 
Generalsetting register, associated file Pin
pnpfriend24-Jan-04 9:53
pnpfriend24-Jan-04 9:53 
GeneralStarting PowerPoint in a webbrowser control Pin
gregcost24-Jan-04 8:28
gregcost24-Jan-04 8:28 
GeneralChanging the color of a TabPage tab Pin
nvmoss24-Jan-04 3:09
nvmoss24-Jan-04 3:09 
GeneralRun an external application hidden Pin
gregcost23-Jan-04 7:03
gregcost23-Jan-04 7:03 
GeneralExcel feedback in VB6 Pin
clockit23-Jan-04 2:51
clockit23-Jan-04 2:51 
GeneralRe: Excel feedback in VB6 Pin
-Dr_X-24-Jan-04 13:27
-Dr_X-24-Jan-04 13:27 
GeneralRe: Excel feedback in VB6 Pin
clockit26-Jan-04 2:23
clockit26-Jan-04 2:23 
GeneralRe: Excel feedback in VB6 Pin
-Dr_X-26-Jan-04 3:28
-Dr_X-26-Jan-04 3:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.