forked from brettz9/dialog-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmsgbox.vbs
More file actions
executable file
·25 lines (23 loc) · 778 Bytes
/
Copy pathmsgbox.vbs
File metadata and controls
executable file
·25 lines (23 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Function BrowseForFile( dialogText )
Dim shell : Set shell = CreateObject("Shell.Application")
Dim file : Set file = shell.BrowseForFolder(0, dialogTitle, 0)
BrowseForFile = file.self.Path
End Function
Set objArgs = WScript.Arguments
dialogType = objArgs(0)
dialogTitle = objArgs(1)
dialogText = objArgs(2)
If dialogType = "notification" Then
MsgBox dialogText, 0, dialogTitle
ElseIf dialogType = "question" Then
answer = MsgBox( dialogText, vbOKCancel, dialogTitle )
Wscript.Stdout.Write answer
ElseIf dialogType = "entry" Then
entryText = InputBox( dialogText, dialogTitle )
Wscript.Stdout.Write entryText
ElseIf dialogType = "fileselect" Then
fileName = BrowseForFile(dialogTitle)
WScript.echo fileName
Else
WScript.Echo "unknown dialog type"
End If