Hi
Anyone knows of a simple macro to move files?
Ive tried googeling for a while now, but havnt faound anything I can make work.
I want to be able to use a directory input to get all files.
They contains which week they are created and a customer number.
From that info I want to move the files to the correct sub folder based on Customer number and week.
So:
FileName: Dennis_Schlein (Customer) 270183 (ID) - Week 8.
Destination:
P:\Invoice\[Customer name]\Week 8\
Anyone who can assist with something like this?
Kind regards
Solved! Go to Solution.
Hello @Hamder83 ,
To move files you would need yo use the command tool. The best way to do it would be to create a batch macro with the following command
move "<origin>" "<destination>"
The quotes are important and useful just in case any path has some spaces (we would avoid that error this way).
Here is a macro that does it:
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Regards
You are a god!
That works like a charm 🙂
Thank you very much
Glad you liked it.
You can also switch the command within to create folders, delete files etc.
Also don't know if you are aware but when moving the files you can also rename them at the same time:
move "C:\Users\IronMan\Documents\old_name.xlsx" "C:\Users\ESd01631\Documents\secrets\new_name.xlsx"
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Regards
Hi @afv2688
One last question,i tried and change it to my own folder path.
But now i get a error message: code 1?
Hello @Hamder83,
The error code one can be related to many things. Most of the times is either given due a mistype, path not existing or a permission issue.
To check it out I would recommend you to try to run the command you are passing to your workflow directly into a cmd window. There you will be able to see what is really happening.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Regards