How change specific file extension ?
Code:
Sub changeExt()
strDir = ThisWorkbook.Path & "\"
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(strDir)
With CreateObject("wscript.shell")
For Each file In f.Files
If InStr(file.Name, "root.zip") > 0 Then
.currentdirectory = strDir
.Run "%comspec% /c ren *.zip *.docx", 0, True
End If
Next
End With
End Sub
Sub changeExt1()
strDir = ThisWorkbook.Path & "\"
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(strDir)
With CreateObject("wscript.shell")
For Each file In f.Files
If InStr(file.Name, "root.docx") > 0 Then
.currentdirectory = strDir
.Run "%comspec% /c ren *.docx *.zip", 0, True
End If
Next
End With
End Sub