I made a install script for MalwareBytes to do a Silent install.
UPDATED VERSION 2 With auto detect if Invoke-WebRequest exists
Improvements are welcome!
Change the version if needed in the Source URL: https://data-cdn.mbamupdates.com/web/mb3-setup-consumer-3.0.6.1469.exe
# Silent Install MalwareBytes
# Download URL: https://www.malwarebytes.com/mwb-download/thankyou/
# Path for the workdir
$workdir = "c:\installer\"
# Check if work directory exists if not create it
If (Test-Path -Path $workdir -PathType Container)
{ Write-Host "$workdir already exists" -ForegroundColor Red}
ELSE
{ New-Item -Path $workdir -ItemType directory }
# Download the installer
$source = "https://data-cdn.mbamupdates.com/web/mb3-setup-consumer-3.0.6.1469.exe"
$destination = "$workdir\mbam.exe"
Invoke-WebRequest $source -OutFile $destination
# Start the installation
Start-Process -FilePath "$workdir\mbam.exe" -ArgumentList "/NOCANCEL /NORESTART /VERYSILENT /SUPPRESSMSGBOXES"
# Wait XX Seconds for the installation to finish
Start-Sleep -s 35
# Remove the installer
rm -Force $workdir\mbam*
For Windows 7 please change
$source = "https://data-cdn.mbamupdates.com/web/mb3-setup-consumer-3.0.6.1469.exe"
$destination = "$workdir\mbam.exe"
Invoke-WebRequest $source -OutFile $destination
To
$WebClient = New-Object System.Net.WebClient
$WebClient.DownloadFile("https://data-cdn.mbamupdates.com/web/mb3-setup-consumer-3.0.6.1469.exe","$workdir\mbam.exe")
Since Powershell in Windows 7 does not support the Invoke-WebRequest
I made a install script for CCleaner to do a Silent install and clean if needed.
UPDATED VERSION 3 With auto detect if Invoke-WebRequest exists
Improvements are welcome!
When a new version of CCleaner comes out, just change the ccsetup526 to the new value.
# CCleaner Download / Update Location
# http://www.piriform.com/ccleaner/download
mkdir C:\CCleanerInstall
Invoke-WebRequest http://download.piriform.com/ccsetup526.exe -OutFile C:\CCleanerInstall\ccsetup526.exe
Start-Process -FilePath "c:\CCleanerInstall\ccsetup526.exe" -ArgumentList "/S"
Start-Sleep -s 20
rm-R -Force C:\CCleanerInstall
If you want you can also add:
Start-Process -FilePath "C:\Program Files\CCleaner\CCleaner.exe" -ArgumentList "/CLEANER /AUTO"
Start-Sleep -s 20
This will do a Auto Clean with CCleaner
You can add this to Scripts as a PowerShell Script.