Upload files to "Utility Scripts"
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
$Path = "C:\Temp\"
|
||||
$Word_App = New-Object -ComObject Word.Application
|
||||
|
||||
$Format = [Microsoft.Office.Interop.Word.WdSaveFormat]::wdFormatXMLDocument
|
||||
|
||||
$List = Get-ChildItem -Path $Path -Recurse -File -Filter '*.doc' | Where-Object { $_.Name -match '.+\.doc$' }
|
||||
Foreach ($Item in $List) {
|
||||
if ($Item.Name -match '.+.doc$') {
|
||||
$Document = $Word_App.Documents.Open($Item.FullName)
|
||||
$Docx_Filename = "$($Item.DirectoryName)\$($Item.BaseName).docx"
|
||||
$Document.SaveAs([ref]$docx_filename, [ref]$Format)
|
||||
$Document.Close()
|
||||
#Remove-Item -Path $Item.FullName -Force
|
||||
}
|
||||
}
|
||||
$word_app.Quit()
|
||||
Reference in New Issue
Block a user