0

I'm trying to move all files and folders within a directory to another location. I thought

movefile('D:\path\to\source\*', 'D:\destination\folder')

would work, but this gives me an error

Error using movefile
The requested lookup key was not found in any active activation context.
HappyPy
  • 9,839
  • 13
  • 46
  • 68
  • 1
    That does not look like an error message from built-in movefile. Try "which movefile" and make sure there are no other overloaded variables or functions. – Navan Sep 12 '18 at 19:26
  • @Navan: Thanks. `which movefile` tells me it's the builtin the function. I noticed that only files are moved but not folders. I thought the wildcard `*` would move both but it does not seem to be the case. Is there a way to tell `movefile` to move folders as well? – HappyPy Sep 12 '18 at 21:11
  • movefile should move both files and directories when you use *. You need to be careful when using * to avoid recursion if the directory you are moving to is also under current directory. – Navan Sep 21 '18 at 18:45

0 Answers0