Monday, January 30, 2017

Remove Office 16 Click-to-Run Extensibility Component

We can't install the 32-bit version of Office because we found the following 64-bit programs on your PC:
Office 16 Click-to-Run Extensibility Component 64-bit Registration
Please uninstall all 64-bit Office programs, then retry installing 32-bit Office.
If you want to install 64-bit Office instead, please run the 64-bit setup.

Solution is delete product code under
HKEY_CLASSES_ROOT\Installer\Products

To detect if everything is clear I can use:
reg query HKEY_CLASSES_ROOT\Installer\Products /s | findstr "Click-to-Run"

Wednesday, January 25, 2017

GanttProject deploy, SCCM

This is tested with file
ganttproject-2.8.1-r2024.exe
7f260ddb66432d6b0afa011ea45da541
4b214687c1e50038ef0ce89628fe76bef03d5f45

silent-install.cmd
@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=GanttProject
set n=GanttProject
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
reg query "%sw%\%x%%u%\%k%" > nul 2>&1
if not !errorlevel!==0 (
for /f "tokens=*" %%a in ('dir /b "%~dp0ganttproject*.exe"') do (
echo %n%
start /wait "" "%~dp0%%a" /S
)
) else echo %n% already installed!

:detectAppOn64bitSystem
dir /b "%programfiles(x86)%\GanttProject*"
if !errorlevel!==0 goto exist
:detectAppOn32bitSystem
dir /b "%programfiles%\GanttProject*"
if not !errorlevel!==0 goto detectAppOn64bitSystem
:exist
endlocal

silent-uninstall.cmd
@echo off
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=GanttProject
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
for /f delims^=^"^ tokens^=2 %%a in ('^
reg query "%sw%\%x%%u%\%k%" /v UninstallString ^|
find "UninstallString"') do (
start /wait "" "%%a" /S
)
:recheck
"%~dp0sleep.exe" 1
if exist "%ProgramFiles(x86)%\GanttProject-2.8" goto recheck
if exist "%ProgramFiles%\GanttProject-2.8" goto recheck
"%~dp0sleep.exe" 1

To get sleep.exe select "Save Target As" on sleep.7z and save as sleep.7z. Extract the file with 7-zip.

Detection rule for SCCC:


Greenshot deploy, SCCM

Get installer:
http://getgreenshot.org/downloads/

This particular example is tested together with Greenshot-INSTALLER-1.2.9.112-RELEASE
1b4b8eed60f9ae4607fbdf8432c19801
3f97c7f00df9341413c3aa8413e68dd5230c471d

silent-install.cmd
@echo off
if exist "%programfiles%\Greenshot" goto installed
for /f "tokens=*" %%a in ('dir /b "%~dp0Greenshot-INSTALLER*.exe"') do (
echo Greenshot
start /wait "" "%~dp0%%a" /SILENT
)
:installed

silent-uninstall.cmd
@echo off
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=Greenshot_is1
setlocal EnableDelayedExpansion
for /f delims^=^"^ tokens^=2 %%a in ('^
reg query "%sw%\%u%\%k%" /v UninstallString ^|
find "UninstallString"') do (
tasklist | find /I "Greenshot.exe"
if !errorlevel!==0 "%~dp0pskill.exe" /accepteula "Greenshot.exe"
start /wait "" "%%a" /SILENT
)
:exist
if exist "%programfiles%\Greenshot" goto exist
endlocal

Detection rule:

Monday, January 23, 2017

Assign SSL certificate check template to Zabbix server, assign to host

Click "Save Target As" on Zbx_export_templates.xml

Import Zbx_export_templates.xml into zabbix templates

Create host and assign Zbx_export_templates.xml template to host

Solve "[2] no such file or direcotry"
Move to zabbix directory:
cd /var/zabbix/
Check if the directory is owned by zabbix:
ls -l
Move to externalscripts
cd externalscripts
Check what content is there:
ls -l
Download zext_ssl_cert.sh. Remember original file start with capital leter but I need all small caps!
curl https://www.zabbix.org/mw/images/7/71/Zext_ssl_cert.sh > zext_ssl_cert.sh
Solve "[13] Permission denied"
chown -R zabbix:zabbix /var/zabbix/externalscripts
chmod 755 /var/zabbix/externalscripts/zext_ssl_cert.sh
Here is video of whole process:

Calculate is certificate good, pem file

#returns 0 if the certificate can pass another day
if openssl x509 -checkend 86400 -noout -in cert.pem; then echo 0; else echo 1; fi

#returns 0 if the certificate can pass another 10 days
if openssl x509 -checkend 864000 -noout -in cert.pem; then echo 0; else echo 1; fi

#returns 0 if the certificate can pass another 100 days
if openssl x509 -checkend 8640000 -noout -in cert.pem; then echo 0; else echo 1; fi

Sunday, January 22, 2017

Customize Dynamic Blogger Template

To modify blogger template I have to re-compile custom part of blogger section.

In this example I will show how to find the content of "BloggerPost" section. Delete Social Shared buttons part.
At the end the custom modification needs to be compiled and injected before page loads.

At first I need to enter Web Browsers Developer mode.

Open Console section

Execute command:
blogger.templates()
Now I expand Jd
Expand C
Expand BloggePost

There is element pg

I need mouse over to the content in double quotes. Then I double click to select content.
Hit Ctrl+C to copy


navigate to the Notepad++

Paste content in save the file instantly as xml to better qualify the content.

Delete the section which is responsible for the share buttons
{block:IfNotdisable-sharing}
{Sharing url='{Permalink}' httpUrl='{HttpPermalink}' text='{HTMLEscapedTitle}' width="90" defer="{defer-sharing}" delay='1000'}
{/block:IfNotdisable-sharing}
Remove empty lines and all white spaces and the begging of lines and end of lines.

Open Notepad++ replace dialog and set "Regular Expression" mode
replace ^ with '
replace $ with ' +
replace > with >
replace < with &lt;

Remove double quote sysmbol at the start and end of content.

Copy the code and inject this all as JavaScript code in
blogger.templates().compile(

);
At the end it looks like:
blogger.templates().compile(
'{template:BloggerPost}' +
'&lt;div class="article hentry {TagsAsClasses} {block:HasAdsense}has-ads{/block:HasAdsense}" itemscope itemtype="http://schema.org/BlogPosting"&gt;' +
'{PostMetaData}' +
'{block:HasAdsense}' +
'&lt;div class="adsense-aside"&gt;' +
'{Adsense format="vertical"}' +
'&lt;/div&gt;' +
'{/block:HasAdsense}' +
'&lt;div class="article-header"&gt;{PostHeader}&lt;/div&gt;' +
'{block:item}' +
'&lt;div class="article-content entry-content" itemprop="articleBody"&gt;{Body}&lt;/div&gt;' +
'&lt;div class="article-footer"&gt;' +
'{PublishInfo}' +
'{GeoLocationInfo}' +
'{block:HasTags}' +
'&lt;div class="labels" itemprop="keywords"&gt;' +
'{lang:Labels}: {block:Tags}&lt;a class="label" href="{TagURL}" target="_self"&gt;{Tag}&lt;/a&gt; {/block:Tags}' +
'&lt;/div&gt;' +
'{/block:HasTags}' +
'&lt;/div&gt;' +
'{block:HasAdsense}' +
'&lt;div class="adsense-footer"&gt;' +
'{Adsense format="horizontal"}' +
'&lt;/div&gt;' +
'{/block:HasAdsense}' +
'{block:IfNotdisable-comments}' +
'{block:HasComments}' +
'{block:IfNotIframeComments}' +
'{Comments defer="{defer-comments}"}' +
'{/block:IfNotIframeComments}' +
'{block:IfIframeComments}' +
'{GComments defer="{defer-comments}"}' +
'{/block:IfIframeComments}' +
'{/block:HasComments}' +
'{/block:IfNotdisable-comments}' +
'{/block:item}' +
'&lt;/div&gt;' +
'{/template:BloggerPost}');

Open Blogger template and inject this function before:
blogger.ui().configure().view();

Thursday, January 19, 2017

Increase width of dynamic view, Blogger

.overview-wrap{
max-width: 1600px !important;
}
  
.viewitem-panel .viewitem-content, .classic li.item, .article, .ss {
max-width: 1600px !important;
}

Acrobat Reader DC silent install

This will:
  • Detect and install Acrobat Reader DC
  • Upgrade existing Acrobat Reader DC version

Instruction:

Download base installer:
http://ardownload.adobe.com/pub/adobe/reader/win/AcrobatDC/1500720033/AcroRdrDC1500720033_en_US.msi
03602e4c6f342f6cf8253661c72c6638
d509f92d07774197ae044cd248ae9fd888b73bb1

Download patch:
http://ardownload.adobe.com/pub/adobe/reader/win/AcrobatDC/1502320056/AcroRdrDCUpd1502320056.msp
4bbea0be6385a9829864b8904a30b95f
993d00fe594cc913c7ab1af4d4ae35fffcaacad3

silent-install.cmd
@echo off
setlocal EnableDelayedExpansion
set U=Microsoft\Windows\CurrentVersion\Uninstall
set v=DisplayVersion
set AR={AC76BA86-7AD7-1033-7B44-AC0F074E4100}
if "%ProgramFiles(x86)%"=="" (
set SW=HKLM\SOFTWARE
) else (
set SW=HKLM\SOFTWARE\Wow6432Node
)

reg query "%SW%\%U%\%AR%" > nul 2>&1
if !errorlevel!==0 (

reg query "%SW%\%U%\%AR%" /v %v% | findstr "15.007.20033"
if !errorlevel!==0 goto reinstall
reg query "%SW%\%U%\%AR%" /v %v% | findstr "15.010.20056"
if !errorlevel!==0 goto reinstall
reg query "%SW%\%U%\%AR%" /v %v% | findstr "15.010.20059"
if !errorlevel!==0 goto reinstall
reg query "%SW%\%U%\%AR%" /v %v% | findstr "15.010.20060"
if !errorlevel!==0 goto reinstall
reg query "%SW%\%U%\%AR%" /v %v% | findstr "15.016.20039"
if !errorlevel!==0 goto reinstall
reg query "%SW%\%U%\%AR%" /v %v% | findstr "15.016.20041"
if !errorlevel!==0 goto reinstall
reg query "%SW%\%U%\%AR%" /v %v% | findstr "15.017.20050"
if !errorlevel!==0 goto reinstall
reg query "%SW%\%U%\%AR%" /v %v% | findstr "15.017.20053"
if !errorlevel!==0 goto reinstall

echo now the version is:
reg query "%SW%\%U%\%AR%" /v %v% | findstr "%v%"
goto AdbRdrOK
) else echo Acrobat Reader DC DC not found!

:reinstall

reg query "%SW%\%U%\%AR%" > nul 2>&1
if !errorlevel!==0 (
echo found version
reg query "%SW%\%U%\%AR%" /v %v% | findstr "%v%"
echo uninstalling..
%systemroot%\system32\msiexec.exe /X %AR% /qb
)

start /wait "" %systemroot%\system32\msiexec.exe ^
/i "%~dp0AcroRdrDC1500720033_en_US.msi" ^
PATCH="%~dp0AcroRdrDCUpd1502320056.msp" ^
EULA_ACCEPT=YES /qn /norestart

:AdbRdrOK
endlocal

Please check your USB keyboard connection for the presence of a keylogger

"A change in the USB keyboard connection has detected. Please check your USB keyboard connection for the presence of a keylogger."


Go to LES server. Open Management Console. Click Machine-specific settings - > Insert Computer:

Search for computer name and click add

Select computer object and set options:

Scroll down for USB key logger options, uncheck "Block, notify and log event":

Send policy to client:
On the client computer unplug and plug USB keyboard and celebrate :)

Wednesday, January 18, 2017

Update Lumension EndPoint to HEAT EndPoint

I have Server 2008 R2 running Lumension Enspoint Security server.
It is using "Microsoft SQL Server 2008 R2" as database.
I am going to update Lumension Endpoint Security 4.6 to HEAT EndPoint Security 5.0.0

These are the main guidelines I do to update server

  • Turn Off server
  • Create a snapshot
  • Turn on server
  • Log on into Lumension server with user which is used by "SQL Server" Service
  • Unload antivirus
  • Extract EndpointSecurity_5.0.0.zip
    d35ec1eece38f94fda1dfd7cb3f33a46
    9a2b3221ba53717c1b53903d0c62f335eb0aab3c
  • Open EndpointSecurity_5.0.0 directory
  • Install content inside db directory
  • Install sxs
  • Install smc

Tuesday, January 17, 2017

Can not clear CCM cache, Server 2008 R2

If I open Convtrol Panel and search for Configuration Manager, Open Cache Section and Hit [Configuration Settings]

[Yes]

Then nothing happens!

Turns out "SMS Agent Host" needs to be started:

Clear SCCM Client cache, PowerShell

I can confirm this script are working well on Windows 8.1

First I need to run PowerShell in "Run as Administrator" mode.
"SMS Agent Host" service must be in status "Running"

https://gallery.technet.microsoft.com/scriptcenter/Deleting-the-SCCM-Cache-da03e4c7

<# 
********************************************************************************************************** 
*                                                                                                        * 
*** This Powershell Script is used to clean the CCM cache of all non persisted content                  ** 
*                                                                                                        * 
********************************************************************************************************** 
* Created by Ioan Popovici, 13/11/2015  | Requirements Powershell 3.0                                    * 
* =======================================================================================================* 
* Modified by   |    Date    | Revision |                            Comments                            * 
*________________________________________________________________________________________________________* 
* Ioan Popovici | 13/11/2015 | v1.0      | First version                                                 * 
* Ioan Popovici | 16/11/2015 | v1.1      | Improved Loging                                               * 
* Ioan Popovici | 16/11/2015 | v1.2      | Vastly Improved                                               * 
*--------------------------------------------------------------------------------------------------------* 
*                                                                                                        * 
********************************************************************************************************** 
 
    .SYNOPSIS 
        This Powershell Script is used to clean the CCM cache of all non persisted content. 
    .DESCRIPTION 
        This Powershell Script is used to clean the CCM cache of all non persisted content that is not needed anymore. 
        It only cleans packages, applications and updates that have a installed status and are not persisted, other  
        chache items will NOT be cleaned. 
#> 
 
##Initialization 
CLS 
 
#Global variable 
$Global:Result  =@()  
 
#Set log path 
$ResultCSV = "C:\Clean-CCMCache.log" 
 
#Remove previous log it it's more than 500 KB 
If (Test-Path $ResultCSV) { 
    If ((Get-Item $ResultCSV).Length -gt 500KB) { 
        Remove-Item $ResultCSV -Force | Out-Null 
    } 
} 
 
#Get log parent path 
$ResultPath =  Split-Path $ResultCSV -Parent 
 
#Create path directory if it does not exist 
If ((Test-Path $ResultPath) -eq $False) { 
    New-Item -Path $ResultPath -Type Directory | Out-Null 
} 
 
#Get the current date 
$Date = Get-Date 
 
#Get list of all non persisted content in CCMcache, only this content will be removed 
$CM_CacheItems = Get-WmiObject -Namespace root\ccm\SoftMgmtAgent -Query 'SELECT ContentID,Location FROM CacheInfoEx WHERE PersistInCache = 0' 
 
#Get list of updates 
$CM_Updates = Get-WmiObject -Namespace root\ccm\SoftwareUpdates\UpdatesStore -Query 'SELECT UniqueID,Title,Status FROM CCM_UpdateStatus' 
 
#Get list of applications 
$CM_Applications = Get-WmiObject -Namespace root\ccm\ClientSDK -Query 'SELECT * FROM CCM_Application' 
 
#Get list of packages 
$CM_Packages = Get-WmiObject -Namespace root\ccm\ClientSDK -Query 'SELECT PackageID,PackageName,LastRunStatus,RepeatRunBehavior FROM CCM_Program' 
 
##Functions 
 
#This function is used to remove the cache item pushed trough it if it's not persisted 
Function Remove-CacheItem { 
    param ( 
        [Parameter(Mandatory = $true, Position = 0)] 
        [Alias('CacheTD')] 
        [string]$CacheItemToDelete, 
        [Parameter(Mandatory = $true, Position = 0)] 
        [Alias('CacheN')] 
        [string]$CacheItemName 
    ) 
 
    #Delete chache item if it's non persisted 
    If ($CM_CacheItems.ContentID -contains $CacheItemToDelete) { 
 
        #Get Cache item location and size 
        $CacheItemLocation = $CM_CacheItems | Where {$_.ContentID -Contains $CacheItemToDelete} | Select -ExpandProperty Location 
        $CacheItemSize =  Get-ChildItem $CacheItemLocation -Recurse -Force | Measure-Object -Property Length -Sum | Select -ExpandProperty Sum 
 
        #Build result object 
        $ResultProps = [ordered]@{ 
            'DeletionDate'  = $Date 
            'Name' = $CacheItemName 
            'ID' = $CacheItemToDelete 
            'Location' = $CacheItemLocation 
            'Size(MB)' = "{0:N2}" -f ($CacheItemSize / 1MB) 
            'TotalDeleted(MB)' = '' 
        } 
 
        #Add items to result object 
        $Global:Result  += New-Object PSObject -Property $ResultProps 
 
        #Connect to resource manager COM object 
        $CMObject = New-Object -ComObject "UIResource.UIResourceMgr" 
 
        #Use GetCacheInfo method to return cache properties 
        $CMCacheObjects = $CMObject.GetCacheInfo() 
 
        #Delete Cache element 
        $CMCacheObjects.GetCacheElements() | Where-Object {$_.ContentID -eq $CacheItemToDelete} |  
            ForEach-Object {  
                $CMCacheObjects.DeleteCacheElement($_.CacheElementID) 
            } 
    }  
} 
 
##Main Script 
 
#Reset progress Counter 
$ProgressCounter = 0 
 
#Check for installed applications (adapted) 
Foreach ($Application in $CM_Applications) { 
 
    #Show progrss bar 
    If ($CM_Applications.Count -ne $null) {  
        $ProgressCounter++ 
        Write-Progress -Activity 'Processing Applications' -CurrentOperation $Application.FullName -PercentComplete (($ProgressCounter / $CM_Applications.Count) * 100) 
        Start-Sleep -Milliseconds 400 
    } 
 
    $Application.Get() 
 
    #Enumerate all deployment types for an application 
    Foreach ($DeploymentType in $Application.AppDTs) { 
        If ($Application.InstallState -eq "Installed" -and $Application.IsMachineTarget) { 
 
            #Get content ID for specific application deployment type 
            $AppType = "Install",$DeploymentType.Id,$DeploymentType.Revision 
            $Content = Invoke-WmiMethod -Namespace root\ccm\cimodels -Class CCM_AppDeliveryType -Name GetContentInfo -ArgumentList $AppType 
 
            #Call Remove-CacheItem function  
            Remove-CacheItem -CacheTD $Content.ContentID -CacheN $Application.FullName 
        } 
    } 
} 
 
#Reset progress Counter 
$ProgressCounter = 0 
 
#Check for installed packages 
Foreach ($Package in $CM_Packages) { 
 
    #Show progrss bar 
    If ($CM_Packages.Count -ne $null) {  
        $ProgressCounter++ 
        Write-Progress -Activity 'Processing Packages' -CurrentOperation $Package.PackageName -PercentComplete (($ProgressCounter / $CM_Packages.Count) * 100) 
        Start-Sleep -Milliseconds 800 
    } 
 
    If ($Package.LastRunStatus -eq "Succeeded" -and $Package.RepeatRunBehavior -ne "RerunAlways" -and $Package.RepeatRunBehavior -ne "RerunIfSuccess") { 
 
        #Call Remove-CacheItem function 
        Remove-CacheItem -CacheTD $Package.PackageID -CacheN $Package.PackageName 
    }    
} 
 
#Reset progress Counter 
$ProgressCounter = 0 
 
#Check for installed updates 
Foreach ($Update in $CM_Updates) { 
 
    #Show Progrss bar 
    If ($CM_Updates.Count -ne $null) {   
        $ProgressCounter++ 
        Write-Progress -Activity 'Processing Updates' -CurrentOperation $Update.Title -PercentComplete (($ProgressCounter / $CM_Updates.Count) * 100) 
    } 
 
    If ($Update.Status -eq "Installed") { 
 
        #Call Remove-CacheItem function  
        Remove-CacheItem -CacheTD $Update.UniqueID -CacheN $Update.Title 
    } 
} 
 
#Sort by size descending 
$Result =  $Global:Result | Sort-Object Size`(MB`) -Descending 
 
#Calculate total deleted size 
$TotalDeletedSize = $Result | Measure-Object -Property Size`(MB`) -Sum | Select -ExpandProperty Sum 
 
#Build result object 
$ResultProps = [ordered]@{ 
    'DeletionDate' = $Date 
    'Name' = 'Total Size of Items Deleted in MB:' 
    'ID' = '' 
    'Location' = '' 
    'Size(MB)' = '' 
    'TotalDeleted(MB)' = $TotalDeletedSize 
} 
 
#Add total items deleted to result object 
$Result += New-Object PSObject -Property $ResultProps 
 
#Write result object to csv file (append) 
$Result | Export-Csv -Path $ResultCSV -Delimiter ";" -Encoding UTF8 -NoTypeInformation -Append -Force 
 
#Write to console 
$Result | Format-Table Name,TotalDeleted`(MB`)

Monday, January 16, 2017

PXE-M0F: Exiting PXE ROM

PXE Boot aborted. Booting to next device...
PXE-M0F: Exiting PXE ROM.
No bootable device -- insert boot disk and press any key

My situation is:
  • deploying OS to the laptop with external usb-c to RJ45 adapter
  • system center configuration manager 2012 R2
  • deploying operating system to "Unknown Computers" collection

Reason why this happen:
  • SCCM assinged usb-c to RJ45 adapter to computer object
  • New PXE boot instance recognize MAC address of external usb-c to RJ45 adapter and do not let to deploy OS in this case

Solution:
  • Delete last computer object from SCCM console

Sunday, January 15, 2017

The attribute image.itemtype has an invalid value, Blogger


Replace:
    <b:if cond='data:post.firstImageUrl'>
      <meta expr:content='data:post.firstImageUrl' itemprop='image'/>
    </b:if>

with:
    <div itemprop='image' itemscope='itemscope' itemtype='https://schema.org/ImageObject'>
      <b:if cond='data:post.firstImageUrl'>
        <meta itemprop='image' expr:content='data:post.firstImageUrl'/>
        <!-- Images should be at least 696 pixels wide https://developers.google.com/search/docs/data-types/articles -->
        <meta itemprop='width' content='800'/>
        <meta itemprop='height' content='600'/>
  <meta itemprop='url' expr:content='data:post.firstImageUrl' />
      </b:if>
    </div>

image_url is not recognized by Google

"The property image_url is not recognized by Google for an object of type BlogPosting"

Solution is to open blogger template and replace:
<b:if cond='data:post.firstImageUrl'>
<meta expr:content='data:post.firstImageUrl' itemprop='image_url'/>
</b:if>

with:
<b:if cond='data:post.firstImageUrl'>
<meta expr:content='data:post.firstImageUrl' itemprop='image'/>
</b:if>

Add dateModified, Blogger

This will add dateModified timestamp in ISO8601 format.

<b:if cond='data:post.dateHeader'>
<div expr:id='&quot;date-header&quot;'>
Last Updated: 
<abbr class='published' expr:content='data:post.lastUpdatedISO8601' itemprop='dateModified'>
<data:post.lastUpdatedISO8601/>
</abbr>
</div>
</b:if>

Blogger, dateModified, Structure data testing tool


Here is how I fixed this:

Open blogger template and look for section
<b:includable id='post' var='post'>
<div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'>

Replace with:
<b:includable id='post' var='post'>
<div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'>
<meta itemscope='itemscope' itemprop='mainEntityOfPage'  itemType='https://schema.org/WebPage' expr:itemid='data:post.link ? data:post.link : data:post.url'/>
<meta expr:content='data:post.timestamp' itemprop='datePublished'/>
<meta expr:content='data:post.lastUpdatedISO8601' itemprop='dateModified'/>

Related:
https://search.google.com/structured-data/testing-tool

Saturday, January 14, 2017

DAEMON Tools Lite silent uninstall

This is tested with DAEMON Tools Lite version 10.5 and works on 64-bit Windows 8.1

No need additional libraries. I need to just execute the following code in "Run As Administrator" mode

silent-unisntall.cmd
@echo off
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=DAEMON Tools Lite
for /f "tokens=*" %%a in ('^
reg query "%sw%\%u%\%k%" /v UninstallString ^|
find "UninstallString"') do set "str=%%a"
set "first=%str:    REG_SZ    =" & set "UninstallString=%"
start /wait "" "%UninstallString%" /S

Home:
https://www.daemon-tools.cc/products/dtlite

Greenshot silent uninstall

To kill a running Greenshot instance I use:
http://live.sysinternals.com/Tools/PsKill.exe

This is tested on Greenshot version 1.2.9 on 64-bit Windows

silent-uninstall.cmd
@echo off
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=Greenshot_is1
setlocal EnableDelayedExpansion
for /f delims^=^"^ tokens^=2 %%a in ('^
reg query "%sw%\%u%\%k%" /v UninstallString ^|
find "UninstallString"') do (
tasklist | find /I "Greenshot.exe"
if !errorlevel!==0 "%~dp0pskill.exe" /accepteula "Greenshot.exe"
start /wait "" "%%a" /SILENT
)
endlocal

Greenshot silent install

Download latest installer:
http://getgreenshot.org/downloads/

This is tested on version 1.2.9
Greenshot-INSTALLER-1.2.9.112-RELEASE.exe
1b4b8eed60f9ae4607fbdf8432c19801
3f97c7f00df9341413c3aa8413e68dd5230c471d

silent-install.cmd
@echo off
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=Greenshot_is1
set n=Greenshot
setlocal EnableDelayedExpansion
reg query "%sw%\%x%\%k%" > nul 2>&1
if not !errorlevel!==0 (
for /f "tokens=*" %%a in ('dir /b "%~dp0Greenshot-INSTALLER*.exe"') do (
echo %n%
start /wait "" "%~dp0%%a" /SILENT
)
) else echo %n% already installed!
endlocal

native exe, static registry key under native hive,
needs to kill process before uninstall

This method applies to Greenshot

To kill a running instance I need:
http://live.sysinternals.com/Tools/PsKill.exe

silent-install.cmd
@echo off
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=Greenshot_is1
set n=Greenshot
setlocal EnableDelayedExpansion
reg query "%sw%\%x%\%k%" > nul 2>&1
if not !errorlevel!==0 (
for /f "tokens=*" %%a in ('dir /b "%~dp0Greenshot-INSTALLER*.exe"') do (
echo %n%
start /wait "" "%~dp0%%a" /SILENT
)
) else echo %n% already installed!
endlocal

silent-uninstall.cmd
@echo off
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=Greenshot_is1
setlocal EnableDelayedExpansion
for /f delims^=^"^ tokens^=2 %%a in ('^
reg query "%sw%\%u%\%k%" /v UninstallString ^|
find "UninstallString"') do (
tasklist | find /I "Greenshot.exe"
if !errorlevel!==0 "%~dp0pskill.exe" /accepteula "Greenshot.exe"
start /wait "" "%%a" /SILENT
)
endlocal

GanttProject silent uninstall

This will detect GanttProject on 64-bit or 32-bit windows and uninstall it

silent-uninstall.cmd
@echo off
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=GanttProject
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
for /f delims^=^"^ tokens^=2 %%a in ('^
reg query "%sw%\%x%%u%\%k%" /v UninstallString ^|
find "UninstallString"') do (
start /wait "" "%%a" /S
)

GanttProject silent install

Download latest version 2 from http://www.ganttproject.biz/

This is tested with:
ganttproject-2.8.1-r2024.exe
7f260ddb66432d6b0afa011ea45da541
4b214687c1e50038ef0ce89628fe76bef03d5f45

silent-install.cmd
@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=GanttProject
set n=GanttProject
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
reg query "%sw%\%x%%u%\%k%" > nul 2>&1
if not !errorlevel!==0 (
for /f "tokens=*" %%a in ('dir /b "%~dp0ganttproject*.exe"') do (
echo %n%
start /wait "" "%~dp0%%a" /S
)
) else echo %n% already installed!
endlocal

ImgBurn silent uninstall

This is tested and works with ImgBurn version 2.5.8.0.

silent-uninstall.cmd
@echo off
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=ImgBurn
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
for /f delims^=^"^ tokens^=2 %%a in ('^
reg query "%sw%\%x%%u%\%k%" /v UninstallString ^|
find "UninstallString"') do (
start /wait "" "%%a" /S
)

Friday, January 13, 2017

JRE 8 silent install

This will:
  • install 32-bit and 64-bit JRE 8 on 64-bit windows
  • install 32-bit JRE 8 on 32-bit windows

silent-install.cmd
@echo off

if not "%ProgramFiles(x86)%"=="" (
for /f "delims=" %%f in ('dir /b "%~dp0jre*x64.exe"') DO (
echo JRE8 64-bit
start /wait "" "%~dp0%%f" /s AUTO_UPDATE=0 WEB_JAVA=1 WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=1 REBOOT=0 SPONSORS=0
)
)

for /f "delims=" %%f in ('dir /b "%~dp0jre*i586.exe"') DO (
echo JRE8 32-bit
start /wait "" "%~dp0%%f" /s AUTO_UPDATE=0 WEB_JAVA=1 WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=1 REBOOT=0 SPONSORS=0
)

echo uninstall JRE updater
msiexec /x {4A03706F-666A-4037-7777-5F2748764D10} /qn

Blog Archive