To do a silent install, just use a '/S' command line switch. I ran into issues because it wouldn't populate the shortcuts when deployed with LANDesk to XP (worked fine with Windows 7, go figure).
I know this is a lot of code to do something that is pretty simple, but 95% of it is functions/snippets of code I reuse.
install.vbs
'Declare scripting objects
Set oNet = WScript.CreateObject("WScript.Network")
Set oShell = WScript.CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oSpecFolders = oShell.SpecialFolders
'Delete the desktop shortcut if this isn't windows XP
If OSVersionLookup = "XP" Then
If oFSO.FolderExists(eAllUsersPrograms & "\Winmail Opener") = False Then oFSO.CreateFolder eAllUsersPrograms & "\Winmail Opener"
CreateIcon eAllUsersDesktop & "\Winmail Opener.lnk",eProgramFiles & "\Winmail Opener\wmopener.exe","","Winmail Opener",eProgramFiles & "\Winmail Opener",eProgramFiles & "\Winmail Opener\wmopener.exe,0"
CreateIcon eAllUsersPrograms & "\Winmail Opener\Winmail Opener.lnk",eProgramFiles & "\Winmail Opener\wmopener.exe","","Winmail Opener",eProgramFiles & "\Winmail Opener",eProgramFiles & "\Winmail Opener\wmopener.exe,0"
End If
sub CreateIcon(sPath,sTarget,sArguments,sDescription,sWorkingDir,sIconLocation)
set oShell = WScript.CreateObject("WScript.Shell")
set oLink = oShell.CreateShortcut(sPath)
oLink.TargetPath = sTarget
oLink.Arguments = sArguments
oLink.Description = sDescription
oLink.WorkingDirectory = sWorkingDir
oLink.IconLocation = sIconLocation
oLink.Save
end Sub
Function GetScriptPath
' Return path to the current script
Dim path
path = WScript.ScriptFullName ' script file name
GetScriptPath = Left(path, InstrRev(path, "\"))
End Function
Function OSVersionLookup
Set oWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = oWMIService.ExecQuery("Select * From Win32_OperatingSystem")
Dim sInstallType
'Check the version of Windows
For Each oItem in colItems
If Instr(oItem.Caption, "Windows Vista") Then
sInstallType = "VISTA"
ElseIf InStr(oItem.caption, "Microsoft Windows 7") Then
sInstallType = "WIN7"
ElseIf InStr(oItem.Caption, "Microsoft Windows XP") Then
sInstallType = "XP"
Else
'Defaulting to UNKNOWN
sInstallType = "UNKNOWN"
End If
Next
OSVersionLookup = sInstallType
End Function
Questions & Answers related to Eolsoft Winmail Opener
Blogs (0)
Blog posts related to Eolsoft Winmail Opener
Links (0)
Links related to Eolsoft Winmail Opener
Reviews (0)
Reviews related to Eolsoft Winmail Opener
This website uses cookies.
By continuing to use this site and/or clicking the "Accept" button you are providing consent
Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our
websites or when you do business with us. For more information about our
Privacy Policy and our data protection
efforts, please visit
GDPR-HQ