7,763
社区成员
发帖
与我相关
我的任务
分享
XRename.exe delete -dir d:\wj\ -string /\d+/g ‘等价于
xrename delete -string /\d+/g
XRename.exe delete -dir d:\wj\ -string /\d+/g
Private Sub Command1_Click()
Dim strPath As String
Dim strName As String
Dim strTemp As String
Dim i As Long
strPath = "D:\wj\" ' 路径最后要有 \
strTemp = Dir$(strPath & "*.txt")
Do
If (strTemp = "") Then Exit Do
strName = strTemp
For i = 0 To 9
strName = Replace(strName, i, "")
Next
If (strName <> strTemp) Then
Name strPath & strTemp As strPath & strName
End If
strTemp = Dir$()
Loop
End Sub
Dim colFiles As Collection
Dim i As Long
Dim s1 As String
Dim s2 As String
Set colFiles = SearchFiles("D:\wj\","*.txt")
For i = 1 To colFiles.Count
s1 = colFiles(i)
s2 = RemoveNumber(s1)
If s1 <> s2 Then
Name s1 As s2
End If
Next