vbs调用Desktop打开窗口

function SelectFolder()

 Const MY_COMPUTER = &H11
 Const WINDOW_HANDLE = &H0

 Const OPTIONS = 0
 Const BIF_returnonlyfsdirs = &H0001  
 Const BIF_editbox= &H0010  
 
 On Error Resume Next
 Set objShell = CreateObject("Shell.Application")
 Set objFolder = objShell.Namespace(MY_COMPUTER)
 Set objFolderItem = objFolder.Self
 strPath = objFolderItem.Path
 Set objShell = CreateObject("Shell.Application")

 Set WshShell = WScript.CreateObject("WScript.Shell")
 strDesktop = WshShell.SpecialFolders("Desktop")
 Set WshShell = Nothing

 Set objFolder = objShell.BrowseForFolder(WINDOW_HANDLE, "",NO_OPTIONS, strDesktop)
 objFolder.Self.path="C:\"
 Set objFolderItem = objFolder.Self
 objPath = objFolderItem.Path
 init_save_path=objPath
 SelectFolder=objPath
 Err.Clear
end Function
SelectFolder()
wscript.sleep("5000")

 

展开阅读全文

没有更多推荐了,返回首页