Locate a File Using a File Open Dialog Box

Erin ·
更新时间:2024-09-20
· 728 次阅读

Demonstration script that displays a File Open dialog box (open to the folder C:\Scripts), and then echoes back the name of the selected file.  Supported Platforms
Windows Server 2003
 No
Windows XP
 Yes
Windows 2000
 No
Windows NT 4.0
 No
Windows 98
 No

Script Code
代码如下:
Set objDialog = CreateObject("UserAccounts.CommonDialog") 
objDialog.Filter = "VBScript Scripts|*.vbs|All Files|*.*" 
objDialog.FilterIndex = 1 
objDialog.InitialDir = "C:\Scripts" 
intResult = objDialog.ShowOpen 
If intResult = 0 Then 
    Wscript.Quit 
Else 
    Wscript.Echo objDialog.FileName 
End If 



open USING file locate dialog box

需要 登录 后方可回复, 如果你还没有账号请 注册新账号
相关文章