Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


How to move multiple files of one type, count, sound notification

Posted on 2003-03-27
Medium Priority
Last Modified: 2010-05-01
I'm attempting to build a program to move music files from a download directory off of kazaa to a different folder, in order to seperate them from the .dat files kazaa creates.  Whenever files are coppied, i would like to know how many were coppied, and have a sound notification that some were.

Any suggestions would be appreciated.
Question by:dragons9
LVL 11

Accepted Solution

supunr earned 1660 total points
ID: 8222759
Add a timer control to your project called Timber1 and set the interval to 60000

Option Explicit

Private Const KazzaFolder = "C:\Program Files\Kazza\Shared Folder\"
Private Const MyMusicFolder = "C:\Mp3s\"

Private Sub Timer1_Timer()
     call AutoCopyFiles
End sub

Private Sub AutoCopyFiles()
     Dim FileName as string
     Dim FilesArr() as String
     Dim FilesCount as Long
     Dim i as Long

     FilesCount = 0
     FileName = Dir(KazzaFolder & "*.mp3")     ' get first file
     Do while (FileName <> "")
          Redim Preserve FilesArr(FilesCount + 1)
          FilesArr(FilesCount) = FileName
          FilesCount = FilesCount + 1
          FileName = Dir     ' get next file
     For i = 0 to FilesCount - 1
          if (Dir(MyMusicFolder & FilesArr(i)) = "") then ' file not found
               ' Move the file
               Name KazzaFolder & FilesArr(i) as MyMusicFolder & FilesArr(i)
               ' or copy file
               'FileCopy KazzaFolder & FilesArr(i), MyMusicFolder & FilesArr(i)
          end if
     Next i
End Sub

' Good LucK!

Author Comment

ID: 8229339
Super script....thanks for your help.  I made a few modifications for what i need, working great.  Learned a few new things too....

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

577 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