|
回复 #9 homyang 的帖子
并不是全改成小写或大写了,而是按发行版本默认的大小写,部分还是兼有大小写的。
要全改成大或小写也很容易,简单改一下就行。
'----------------------------------------------
'Writed by panet8888,bbs.wuyou.net
Do
z = ""
z = InputBox("1则改为大写,2则改为小写","请选择要改写的类型")
If z="" Then
Wscript.Quit
Elseif z=1 or z=2 Then
Exit Do
End If
Loop
Set fso = CreateObject("Scripting.FilesystemObject")
Const MY_COMPUTER = &H10&
Const WINDOW_HANDLE = 0
Const OPTIONS = 0
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(MY_COMPUTER)
Set objFolderItem = objFolder.Self
strPath = objFolderItem.Path
Set objFolder = objShell.BrowseForFolder _
(WINDOW_HANDLE, "选择CDlinux目录:"&vbNewLine&"▲▲▲▲▲▲▲▲", OPTIONS, strPath)
If objFolder Is Nothing Then Wscript.Quit
Set objFolderItem = objFolder.Self
objSourcePath = objFolderItem.Path
If z=1 Then
Change_U objSourcePath
ElseIf z=2 Then
Change_L objSourcePath
End If
Msgbox("Complete!")
Function Change_U(Path)
Set objSourceFolder=fso.GetFolder(Path)
objSourceFolder.Move(Replace(Path,objSourceFolder.Name,UCase(objSourceFolder.Name)))
Set Files=objSourceFolder.Files
For Each j in Files
j.Move(Replace(j.Path,j.Name,UCase(j.Name)))
Next
'历遍
Set objSourceSubFolder=objSourceFolder.SubFolders
For Each k in objSourceSubFolder
Change_U k.Path
Next
End Function
Function Change_L(Path)
Set objSourceFolder=fso.GetFolder(Path)
objSourceFolder.Move(Replace(Path,objSourceFolder.Name,LCase(objSourceFolder.Name)))
Set Files=objSourceFolder.Files
For Each j in Files
j.Move(Replace(j.Path,j.Name,LCase(j.Name)))
Next
'历遍
Set objSourceSubFolder=objSourceFolder.SubFolders
For Each k in objSourceSubFolder
Change_L k.Path
Next
End Function |
|