-
Solved: Simple way of moving all files in a folder
Here is some very simplistic code that doesn't work ... I have looked around this site and others and there appear to be some very complicated ways of doing what I want to do ... is there a simple way ?!?!?
[vba]MkDir ("E:\MyLeagueOld)
Name "E:\MyLeague\*.txt" As "E:\MyLeagueOld\*.txt"
Name "E:\MyLeague\*.pdf" As "E:\MyLeagueOld\*.pdf"
Name "E:\MyLeague\*.xls" As "E:\MyLeagueOld\*.xls"
Name "E:\MyLeague\*.doc" As "E:\MyLeagueOld\*.doc"[/vba]
-
[VBA]ChDrive "E"
MkDir "E:\MyLeagueOld"
Shell "cmd /c move /y " & _
"""" & "E:\MyLeague\*.txt" & """" & " " & _
"""" & "E:\MyLeagueOld" & """", vbHide[/VBA]
Change /c to /k and vbHide to vbNormalFocus if you want to see the results.
We could have used Dir() to iterate the folder's file names and used Name.
Last edited by Kenneth Hobs; 04-01-2009 at 11:44 AM.
-
Brilliant, thanks Kenneth ...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules