Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Using VBA to move system files

Hello,
I have the task of sorting though thousands of music files all of
which all reside in their own folders. There is one main folder
called MUSIC. In that folder is about 2800 folders, each of which has
one or more mp3 files in it. I'd like to write a program which will
scan all of those folders and move (not copy) all of the mp3 files
into one common folder. Can this be done in VBA? If so, please help
me out with some required system commands.

thanks,
Andy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default Using VBA to move system files

HI Andy

Here's how to move a file:

Sub test()
Name "C:\Temp\File.txt" As "D:\Folder\File0001.txt"
End Sub

For all files in a folder with or without subfolders there are plenty of
solutions. Here are first three from googling
vba all files in folder:

http://www.vbaexpress.com/kb/getarticle.php?kb_id=245

http://www.freevbcode.com/ShowCode.Asp?ID=1487

http://www.exceltip.com/st/List_file...Excel/446.html

HTH. Best wishes Harald


"Andrew" wrote in message
...
Hello,
I have the task of sorting though thousands of music files all of
which all reside in their own folders. There is one main folder
called MUSIC. In that folder is about 2800 folders, each of which has
one or more mp3 files in it. I'd like to write a program which will
scan all of those folders and move (not copy) all of the mp3 files
into one common folder. Can this be done in VBA? If so, please help
me out with some required system commands.

thanks,
Andy


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Using VBA to move system files

Thanks Harald. That looks like what I need.

Andy

On Nov 10, 12:32*am, "Harald Staff" wrote:
HI Andy

Here's how to move a file:

Sub test()
Name "C:\Temp\File.txt" As "D:\Folder\File0001.txt"
End Sub

For all files in a folder with or without subfolders there are plenty of
solutions. Here are first three from googling
vba all files in folder:

http://www.vbaexpress.com/kb/getarticle.php?kb_id=245

http://www.freevbcode.com/ShowCode.Asp?ID=1487

http://www.exceltip.com/st/List_file...Microsoft_Scri...

HTH. Best wishes Harald

"Andrew" wrote in message

...

Hello,
I have the task of sorting though thousands of music files all of
which all reside in their own folders. *There is one main folder
called MUSIC. *In that folder is about 2800 folders, each of which has
one or more mp3 files in it. *I'd like to write a program which will
scan all of those folders and move (not copy) all of the mp3 files
into one common folder. *Can this be done in VBA? *If so, please help
me out with some required system commands.


thanks,
Andy


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 420
Default Using VBA to move system files

Just a warning/question...

Won't you have to worry about MP3 files in different starting folders that share
the same name?

I'd copy them to the combined folder and only delete them if the copy didn't
cause heartache.

ps.

When I want to do this kind of thing, I'll use windows explorer's search to
search for *.mp3 files.

Then I could select all of the files in the results window and hit ctrl-x.

Then paste them where I want.

But I'd be careful with the duplicate names destroying files here, too.



On 11/09/2010 20:50, Andrew wrote:
Hello,
I have the task of sorting though thousands of music files all of
which all reside in their own folders. There is one main folder
called MUSIC. In that folder is about 2800 folders, each of which has
one or more mp3 files in it. I'd like to write a program which will
scan all of those folders and move (not copy) all of the mp3 files
into one common folder. Can this be done in VBA? If so, please help
me out with some required system commands.

thanks,
Andy


--
Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default Using VBA to move system files

You're right Dave. "Born to Run" by Bruce might be overwritten by some
Karaoke version.
Additional information needed is probably in John's page
http://spreadsheetpage.com/index.php...3_file_lister/ but Bruce
Karaoke is not easy to hardcode.

Best wishes Harald

"Dave Peterson" wrote in message
...
Just a warning/question...

Won't you have to worry about MP3 files in different starting folders that
share the same name?

I'd copy them to the combined folder and only delete them if the copy
didn't cause heartache.

ps.

When I want to do this kind of thing, I'll use windows explorer's search
to search for *.mp3 files.

Then I could select all of the files in the results window and hit ctrl-x.

Then paste them where I want.

But I'd be careful with the duplicate names destroying files here, too.



On 11/09/2010 20:50, Andrew wrote:
Hello,
I have the task of sorting though thousands of music files all of
which all reside in their own folders. There is one main folder
called MUSIC. In that folder is about 2800 folders, each of which has
one or more mp3 files in it. I'd like to write a program which will
scan all of those folders and move (not copy) all of the mp3 files
into one common folder. Can this be done in VBA? If so, please help
me out with some required system commands.

thanks,
Andy


--
Dave Peterson




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Using VBA to move system files

On Nov 10, 11:27*am, "Harald Staff" wrote:
You're right Dave. "Born to Run" by Bruce might be overwritten by some
Karaoke version.
Additional information needed is probably in John's pagehttp://spreadsheetpage.com/index.php/file/mp3_file_lister/but Bruce
Karaoke is not easy to hardcode.

Best wishes Harald

"Dave Peterson" wrote in message

...

Just a warning/question...


Won't you have to worry about MP3 files in different starting folders that
share the same name?


I'd copy them to the combined folder and only delete them if the copy
didn't cause heartache.


ps.


When I want to do this kind of thing, I'll use windows explorer's search
to search for *.mp3 files.


Then I could select all of the files in the results window and hit ctrl-x.


Then paste them where I want.


But I'd be careful with the duplicate names destroying files here, too.


On 11/09/2010 20:50, Andrew wrote:
Hello,
I have the task of sorting though thousands of music files all of
which all reside in their own folders. *There is one main folder
called MUSIC. *In that folder is about 2800 folders, each of which has
one or more mp3 files in it. *I'd like to write a program which will
scan all of those folders and move (not copy) all of the mp3 files
into one common folder. *Can this be done in VBA? *If so, please help
me out with some required system commands.


thanks,
Andy


--
Dave Peterson


Thanks. That is a good thing to consider. I hadn't thought about the
more simpler method of using explorer to find all mp3s. Sometimes I
think I look for excuses to write programs.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading system log files AltaEgo Excel Programming 4 June 2nd 10 09:24 AM
How do I recover excel 2002 files after a system recovery ran barbraf Excel Worksheet Functions 1 August 22nd 08 12:41 AM
Excel FILES WILL NOT OPEN WITH NEW VISTA OPER SYSTEM Tracy Excel Discussion (Misc queries) 1 November 11th 07 02:21 AM
Opening saved files crash my system Inter Excel Discussion (Misc queries) 3 March 23rd 07 03:01 AM
Excel files transferred to XP system trp754 Excel Discussion (Misc queries) 2 March 30th 05 03:31 PM


All times are GMT +1. The time now is 07:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"