Created
July 23, 2012 00:24
-
-
Save tanaka-takayoshi/3161460 to your computer and use it in GitHub Desktop.
Extract attached media files from an xlsx file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sh = new-object -com shell.application | |
$path = $args[0] | |
$targetfolder = Split-Path $path -parent | |
$zipFile = [System.IO.Path]::ChangeExtension($path,".zip") | |
Copy-Item $path $zipFile | |
$sh.namespace($zipFile).ParseName("xl\media\") | % { $sh.namespace($targetfolder).copyhere($_.Path) } | |
Remove-Item $zipFile | |
Join-Path $targetfolder "media" | Invoke-Item |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment