Power Automate  

πŸ”„ Power Automate Desktop: How to Copy the File to another location (PAD)

πŸ‘‹ Introduction

Hey fellow developers! If you're diving into the world of Power Automate Desktop (PAD), you might already be amazed at how much manual work we can automate — from repetitive clicks to file operations.

Today, let’s talk about something super practical: Copy File actions in Power Automate Desktop. This is especially useful when you're working with folders, backups, or managing file-based workflows.

Let’s break it down step-by-step and see how you can start copying files in your desktop flows like a pro! πŸ§‘‍πŸ’»

πŸ“ What is "Copy File" in Power Automate Desktop?

Just like how we manually copy a file from one folder to another using right-click ➑ copy ➑ paste, PAD provides an action called Copy file to do the same thing in your automation flow.

It comes under:

Actions

Actions ➑ File ➑ Copy file

Actions ➑ File ➑ Copy file

This action allows us to:

  • Copy files from one location to another
  • Handle file name conflicts (overwrite, rename, skip)
  • Set whether to copy file metadata (like timestamps)

πŸ§ͺ Real-Life Use Case

Let’s say you have a folder where reports are generated daily. You want to automatically back them up to a shared drive or another location.

Instead of doing it manually, we’ll automate this:

  • Source: C:\Users\gowth\Downloads\invoice.pdf
  • Destination: C:\Users\gowth\PAD Demo Fodler

πŸ› οΈ How to Use the "Copy File" Action

Let’s walk through the setup in PAD:

βœ… Step 1. Add the Action

  • Open Power Automate Desktop
  • In the left pane, search for Copy file
  • Drag and drop it into the workspace

βœ… Step 2. Configure the Parameters

Field Description
Source file path Full path of the file to copy (C:\Users\gowth\Downloads\invoice.pdf)
Destination file path Where to paste it (C:\Users\gowth\PAD Demo Folder)
If the file exists Choose from: Overwrite, Rename, or Skip
Copy file attributes Check if you want to keep timestamps and metadata

Actions ➑ File ➑ Copy file

πŸ’‘ Tip

If you're copying multiple files, combine it with the For each loop and Get Files in folder action.

πŸ” Copying Multiple Files — Sample Logic

Here’s a simple flow to copy all PDFs from one folder to another:

  1. Get files in a folder
    • Folder: C:\Users\Gowtham\Documents\DailyReports\
    • Filter: *.pdf
  2. For each file in the list
    • Use Copy file
      • Source: %CurrentItem%
      • Destination: D:\Backups\Reports\%Path.GetFileName(CurrentItem)%

This approach handles dynamic file names and avoids hardcoding.

🧯 Handling Errors Gracefully

Sometimes files might be in use, locked, or missing. Use the Begin Error Handling block to catch and handle such issues gracefully, maybe log the failure, skip to next, or retry later.

❓ Common Pitfalls

  • Wrong path format: Always double-check the slashes (\) and use full paths.
  • File already exists: If you forget to handle duplicates, the flow may fail.
  • Permission issues: Make sure PAD has access to the source and destination folders.

βœ… Summary

To wrap it up, the Copy file action is simple yet powerful. Whether you’re automating file backups, moving reports, or preparing folders for processing, this action will save you loads of time.

If you pair this with loops and conditional logic, you can build some very smart flows.

πŸ“š Next Steps

Want to explore more? Try combining this with:

  • Move file
  • Delete file
  • Get file metadata
  • Or trigger this desktop flow from a cloud flow using Power Automate

πŸ™Œ Final Thoughts

Power Automate Desktop is a game-changer for anyone who works with repetitive desktop tasks. Once you start using file actions effectively, you’ll wonder how you lived without them.

Let me know in the comments how you're using file operations in PAD, and if you have any interesting use cases, I’d love to hear!

Happy Automating! πŸš€