-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.vbs
64 lines (47 loc) · 1.79 KB
/
build.vbs
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
' This script loops through the App and QVDLoader Folders and converts any reduced QVWs to real ones.
' It is the inverse operation to reduce.vbs
'Create filesystem object'
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Set Working Directory for relative paths.'
WorkingDir = objFSO.GetParentFolderName(WScript.ScriptFullName)
'Create Logfile'
Set myLog = objFSO.CreateTextFile(WorkingDir & "\build.vbs.log")
mylog.WriteLine Now &" Begin logging..."
'Look in App and QVD Loader and reduce files:'
Set QVWPaths = CreateObject("Scripting.Dictionary")
QVWPaths.Add objFSO.GetFolder(WorkingDir & "\App"), ""
QVWPaths.Add objFSO.GetFolder(WorkingDir & "\QVDLoader"), ""
'ADD OTHER FOLDERS TO BE SEARCHED HERE'
'Loop through folders'
mylog.WriteLine Now & " Looping through Folders"
'Open Qlikview'
Set MyApp = CreateObject("QlikTech.QlikView")
For Each QVWPath in QVWPaths.Keys()
mylog.WriteLine Now & " Searching in: " & QVWPath
For Each QVWFile in QVWPath.Files
If UCase(Right(QVWFile,7)) = ".ND.QVW" Then
mylog.WriteLine Now & " Found No Data QVW: " & QVWFile.Name
Source = QVWFile
Destination = objFSO.GetFolder(QVWPath) & "\" & Left(objFSO.GetBaseName(QVWFile),Len(objFSO.GetBaseName(QVWFile))-3) & ".qvw"
mylog.WriteLine Now & " Generating qvw: " & Destination
objFSO.CopyFile Source, Destination
GenQVW Destination
End If
Next
Next
'Quit'
MyApp.Quit
Set MyDoc = Nothing
Set MyApp = Nothing
mylog.WriteLine Now & " Finished!"
'----------------SUBROUTINES----------------'
Sub GenQVW(QVW)
'Source and destination file paths'
mylog.WriteLine Now & " Creating Full QVW File: " & QVW
'Open File in Qlik'
Set MyDoc = MyApp.OpenDoc(QVW,"","")
mylog.WriteLine Now & " ...File Opened."
'Save and close.'
MyDoc.SaveAs(QVW)
mylog.WriteLine Now & " ...File Saved."
END SUB