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
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
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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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

752 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