Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another Noob question
#2
Macro Macro1706
Code:
Copy      Help
str files="d:\downloads\*.doc" ;;change this
str moveToFolder="c:\folder" ;;change this

mkdir moveToFolder ;;create folder if does not exist
Dir d
foreach(d files FE_Dir) ;;for each file that matches the pattern. The initial code created with dialog "Enumerate files".
,str sPath=d.FileName(1)
,;out sPath ;;debug
,str newFolder.from(moveToFolder "\" _s.getfilename(sPath)) ;;create new folder path
,;out newFolder; continue ;;debug
,mkdir newFolder ;;create new folder for the file
,ren sPath newFolder ;;move the file

run moveToFolder ;;open the destination folder to see what we have


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)