vbs脚本:ExplorerSel


vbs脚本:ExplorerSel
2010年08月09日
  Rem : =========== 打开浏览器,选中指定文件或文件夹 Rem : =========== 文件或文件夹必须存在 Sub ExplorerSel(path) Dim f f = Trim( path ) IfRight(f,1) = "\" Then f = Left(f,Len(f) -1 )If fso.fileexists(f) = False And fso.folderexists(f) = False ThenErr.Raise vbObjectError+128, "ExplorerSel", f & " does not exists" Dim errMsg OnError Resume NextRem ====== code begin shell.Run "explorer.exe /select," & Chr(34) & f & Chr(34),1,TRUE Rem ====== code endIfErr.Number 0 Then errMsg = Err.Description OnError Goto 0 Err.Raise vbObjectError+128, "ExplorerSel", errMsg & vbNewLine & _ " path:" & vbTab & path ExitSubEndIfEndSub

猜你喜欢

转载自nsxd15nsxd.iteye.com/blog/1363183