请问这个代码怎么将拖拽执行改为指定路径执行,在哪里进行修改呢? | Dim ws,fs,rootFolder,message, _ | | cLog,LogName, _ | | EmptyFolder,TempFolder | | Set osh = CreateObject("WScript.Shell") | | set fso = CreateObject("Scripting.FileSystemObject") | | cLog = True | | LogName = WScript.ScriptFullName & "_" & Replace(Replace(FormatDateTime(Now(),vbGeneralDate),"/","-"),":","-") & ".log" | | EmptyFolder = "(_Empty)" | | TempFolder = "(_Temp)" | | | | If WScript.Arguments.Count<1 Then | | WScript.Echo "请把需要缩减的父文件夹拖到本脚本上运行(既使用参数方式提供路径)" | | WScript.Quit | | ElseIf LCase(Right(WScript.FullName,11)) = "wscript.exe" Then | | osh.run "cmd /c cscript.exe //nologo """ & WScript.ScriptFullName & """ """ & WScript.Arguments(0) & """" | | WScript.quit | | End If | | | | | | | | | | | | Function FindChildren(FolderPath) | | set iFolder = fso.GetFolder(FolderPath) | | set iSubFolders = iFolder.SubFolders | | set iFiles = iFolder.Files | | If iFiles.Count= 0 And iSubFolders.count = 1 Then | | For each Cfolder in iSubFolders | | FindChildren = FindChildren(Cfolder) | | Exit For | | Next | | ElseIf iFiles.Count> 0 Or iSubFolders.count > 1 Then | | FindChildren = FolderPath | | Else | | FindChildren = "empty" | | End if | | End Function | | | | | | Function RegExpTest(strng, patrn) | | Dim regEx | | Set regEx = New RegExp | | regEx.Pattern = patrn | | regEx.IgnoreCase = True | | regEx.Global = True | | RegExpTest = regEx.Test(strng) | | Set regEx = Nothing | | End Function | | | | | | If WScript.Arguments.Count<1 Then | | rootFolder = osh.CurrentDirectory | | Else | | rootFolder = WScript.Arguments(0) | | End IfCOPY |
|