iRon
iRon

Reputation: 23663

Invoke Windows copy from PowerShell

I am busy with creating a PowerShell script where a folder needs to be copied to another folder as a part of the script. For this I would like to use the standard Windows copy interface and leverage from the prompts and selections like “There is already a file with the same name in this location.”, “Do you want to merge this folder”, “Do this for all”, etc. instead of programming this all myself.

I investigated a view directions:

But could not find any working solution. Any suggestion how to do this from PowerShell?

Upvotes: 0

Views: 1542

Answers (1)

Deadly-Bagel
Deadly-Bagel

Reputation: 1620

I use this to extract from ZIP files which seems to come up with all the prompts and progress bar:

$shell = New-Object -Com Shell.Application
$folder = $shell.NameSpace(“$path\Folder”)
$shell.NameSpace($otherpath).CopyHere($folder)

Upvotes: 4

Related Questions