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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
Option Explicit
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim MyHex : MyHex = Array(80, 75, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
Dim SpathDocuments : SpathDocuments = WScript.Arguments(0)
Dim sAction : sAction = WScript.Arguments(1)
Dim oFso : Set oFso = CreateObject("Scripting.FileSystemObject")
Dim oShell : Set oShell = CreateObject("WScript.Shell")
Dim oLog : set oLog = oFso.CreateTextFile("log.txt" )
Dim oExec
'Launch
GetCheckIndicators SpathDocuments, sAction
msgbox "End"
oLog.Close
Set oLog = Nothing
Sub GetCheckIndicators(SpathDocuments, sAction)
Dim oFolder, oFile
Dim iGo : iGo = 1
'If the folder DOcuments exists
If oFso.FolderExists(SpathDocuments) Then
'Loop on each folder
For each oFolder in oFso.GetFolder(SpathDocuments).SubFolders
iGo = 1
'Selection based on the NOT ADHOC file
For each oFile in oFolder.Files
If iGo = 1 Then
If UCase(RIGHT(oFile.Name, 1)) <> ".QVW" Then
MsgBox oFile.Name
MsgBox " c:\Program Files\QlikView\QV.exe /r /vvvBinaryFileName= " & oFolder &"\"& oFile.Name & " c:\QLIKVIEW_DOCUMENTS\CheckOut.qvw"
oExec=oShell.Run ("c:\Program Files\QlikView\QV.exe /r /vvBinaryFileName="& oFolder&"\"& oFile.Name & " c:\QLIKVIEW_DOCUMENTS\CheckOut.qvw" )
iGo = 0
End If
End If
Next
If iGo=1 Then
oLog.WriteLine "File : " & oFile.Name
If sAction = "1" Then
'MsgBox "Get Indicators"
oLog.WriteLine " Get Indicators"
End If
End If
Next
'On Error Goto 0
Set oFolder = Nothing
Else
oLog.WriteLine "Répertoire Documents"
End If
End Sub |
Partager