-
Notifications
You must be signed in to change notification settings - Fork 1
/
LTIGetFolder.wsf
executable file
·68 lines (49 loc) · 1.92 KB
/
LTIGetFolder.wsf
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<job id="LTIGetFolder">
<script language="VBScript" src="ZTIUtility.vbs"/>
<script language="VBScript" src="WizUtility.vbs"/>
<script language="VBScript">
' // ***************************************************************************
' //
' // Copyright (c) Microsoft Corporation. All rights reserved.
' //
' // Microsoft Deployment Toolkit Solution Accelerator
' //
' // File: LTIGetFolder.wsf
' //
' // Version: 6.3.8330.1000
' //
' // Purpose: Browse for a folder, returning it via the environment.
' //
' // Usage: cscript.exe [//nologo] LTIGetFolder.wsf [/debug:true]
' //
' // ***************************************************************************
Option Explicit
RunNewInstance
'//----------------------------------------------------------------------------
'// Main Class
'//----------------------------------------------------------------------------
Class LTIGetFolder
'//----------------------------------------------------------------------------
'// Main routine
'//----------------------------------------------------------------------------
'
' Creates a dialog box that enables the user to select a folder and then returns the selected folder's path.
' See: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/objects/shell/browseforfolder.asp
'
Function Main
Dim oFolder
oLogging.CreateEntry "---------------- Initialization ----------------", LogTypeInfo
Set oFolder = nothing
on error resume next
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Select Folder Containing Files", 0, "")
on error goto 0
If oFolder is nothing then
oEnvironment.Item("FolderPath") = oEnvironment.Item("DefaultFolderPath")
Else
oEnvironment.Item("FolderPath") = oFolder.self.Path
End if
Main = Success
End Function
End class
</script>
</job>