Here try this script it should sort ot KB Net and misc exe or msi
Save As Install_Demo_V2.vbs
'-> Objects For Runtime
Dim Act :Set Act = CreateObject("Wscript.Shell")
Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Sys :Set Sys = Act.Environment("System")
Dim Txt :Txt = Act.SpecialFolders("Desktop") & "\Install_Log.txt"
'-> Varibles For Runtime
Dim Ln, Obj, S3, Ts, Var
Ln = "--------------------------------------"
S3 = Space(3)
'-> Create Text File On User Desktop
Set Ts = Fso.CreateTextFile(Txt)
Ts.WriteLine vbTab & "Install Application Log"
Ts.WriteLine Ln
Ts.WriteLine S3 & "Script Run Time : " & Time
Ts.WriteLine S3 & "Script Run Date : " & Date
Ts.WriteLine S3 & "Cpu Architecture : " & Sys("PROCESSOR_ARCHITECTURE")
Ts.WriteLine Ln
'-> Path With The Script In Folder = Fso.GetFolder(".").Files
'-> Path To The Folder To Process = Fso.GetFolder("PATH_TO_FOLDER_TO_PROCESS").Files
For Each Obj In Fso.GetFolder(".").Files
'-> Filter Out EXE In The Folder
Var = Right(LCase(Obj),3)
If Var = "exe" Then
call Install_Exe(Obj.Name,Obj.Path)
End If
If Var = "msi" Then
call Install_Exe(Obj.Name,Obj.Path)
End If
Next
'-> Sort The Exe
Function Install_Exe(N,P)
If InStr(1,N,"kb",1) Then
Ts.WriteLine S3 & "Install Update : " & N & vbCrLf & _
S3 & "Update Location : " & P & vbCrLf & _
" Install Switches Places Holder"
'-> Code Here For Kb EXE
ElseIf InStr(1,N,"net",1) Then
Ts.WriteLine S3 & "Install Update : " & N & vbCrLf & _
S3 & "Net Fw Location : " & P & vbCrLf & _
" Install Switches Places Holder"
'-> Code Here For Net EXE
Else
'-> Code Here For Misc EXE
Ts.WriteLine S3 & "Application Name : " & N & vbCrLf & _
S3 & "Application Path : " & P & vbCrLf & _
" Install Switches Places Holder"
End If
' Ts.WriteLine Ln
call Architecture(N,P)
End Function
'-> Sort The Msi
Function Install_Msi(N,P)
If InStr(1,N,"kb",1) Then
Ts.WriteLine S3 & "Install Update : " & N & vbCrLf & _
S3 & "Update Location : " & P & vbCrLf & _
" Install Switches Places Holder"
'-> Code Here For Kb MSI
ElseIf InStr(1,N,"net",1) Then
Ts.WriteLine S3 & "Install Update : " & N & vbCrLf & _
S3 & "Net Fw Location : " & P & vbCrLf & _
" Install Switches Places Holder"
'-> Code Here For Net MSI
Else
'-> Code Here For Misc MSI
Ts.WriteLine S3 & "Application Name : " & N & vbCrLf & _
S3 & "Application Path : " & P & vbCrLf & _
" Install Switches Places Holder"
End If
call Architecture(N,P)
End Function
'-> OS Architecture
Function Architecture(N,P)
' Ts.WriteLine Ln
Select Case LCase(Sys("PROCESSOR_ARCHITECTURE"))
Case "x86"
'-> Code Here 64 Bit
Ts.WriteLine Space(3) & "Processing 32 Bit Section"
Case "amd64"
'-> Code Here 64 Bit
Ts.WriteLine Space(3) & "Processing 64 Bit Section"
End Select
Ts.WriteLine Ln
End Function
'-> End Of Text File
Ts.Close
'-> Open Text File
Act.Run(Txt),1,True
'-> Ask To Keep Or Delete File
If MsgBox(_
"Would you like to keep this file? Yes to Keep, No to Delete" & vbCrLf & _
Txt,4132,"Keep Or Delete File") = 7 Then Fso.DeleteFile(Txt), True
Rename Install_Demo_V2.vbs.txt to Install_Demo_V2.vbs to make active
Install_Demo_V2.vbs.txt (3.37K)
Number of downloads: 5