Wednesday, September 30, 2015

Skype 7.30 silent install-uninstall, detection method

This is tested on:
http://download.skype.com/msi/SkypeSetup_7.30.0.105.msi
01c2dbf55caede1d3ca17f07f2534ef2
620477e1b45938c7460390dcb4ea156f4c8632c3

silent-install.cmd
@echo off
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
setlocal EnableDelayedExpansion
reg query "HKLM\SOFTWARE\%x%Microsoft\Windows\CurrentVersion\Uninstall" /s | find "Skype"
if not !errorlevel!==0 (
for /f "tokens=*" %%a in ('dir /b "%~dp0SkypeSetup*.msi"') do (
echo Skype
%systemroot%\system32\msiexec.exe /i "%~dp0%%a" /qn
)
) else echo Skype already exists!
endlocal

silent-uninstall.cmd
@echo off
setlocal EnableDelayedExpansion
if "%ProgramFiles(x86)%"=="" goto native

:only64bit
for /f "tokens=8 delims=\" %%a in ('^
reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" /s ^| find "\Uninstall\"') do (
reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\%%a" /v DisplayName | find "Skype" > nul 2>&1
if !errorlevel!==0 (
echo Skype found under %%a
%systemroot%\system32\msiexec.exe /X %%a /qb
)
)

:native
for /f "tokens=7 delims=\" %%a in ('^
reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" /s ^| find "\Uninstall\"') do (
reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%%a" /v DisplayName | find "Skype" > nul 2>&1
if !errorlevel!==0 (
echo Skype found under %%a
%systemroot%\system32\msiexec.exe /X %%a /qb
)
)

endlocal

Tuesday, September 29, 2015

ps aux | grep, eliminate grep process from result

Today with zabbix i have urgent need to eliminate grep process by itself from result.

This is my command at startup:
ps -aux | grep pmon
The problem is that grep process is also listed in the result.

Solution is to add exactly grep -v grep just before actual grep:
ps -aux | grep -v grep | grep pmon
Another solution is to write your keywords first letter into square brackets:
ps -aux | grep "[p]mon"
What was your age when you had to deal with this situation for the first time?
I am 30 now!

Monday, September 28, 2015

KeePass 2 silent install

silent-install.cmd
@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=KeePassPasswordSafe2_is1
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 "%~dp0KeePass*.exe"') do (
echo KeePass 2
start /wait "" "%~dp0%%a" /SILENT
)
) else echo KeePass 2 already installed!
endlocal

Related files:
http://sourceforge.net/projects/keepass/files/KeePass%202.x/

Sunday, September 27, 2015

Disable sleep mode, mac ox x install

Run this command:
caffeinate
DESCRIPTION
caffeinate creates assertions to alter system sleep behavior. if no assertion flags are specified, caffeinate creates an assertion to prevent idle sleep. If a utility is specified, caffeinate creates the assertions on the utility's behalf, and those assertions will persist for the duration of the util-ity's utility's ity's execution. Otherwise, caffeinate creates the assertions directly, and those assertions will per-sist persist sist until caffeinate exits.

Friday, September 25, 2015

Launchy silent install-uninstall, detection rule

Silent install

@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=Launchy_21344213_is1
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 "%~dp0Launchy*.exe"') do (
"%~dp0%%a" /SILENT
)
) else echo Launchy already installed!
if exist "%ProgramFiles(x86)%\Launchy\Launchy.exe" (
"%ProgramFiles(x86)%\Launchy\Launchy.exe"
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" ^
/v Launchy /t reg_sz /d "\"%ProgramFiles(x86)%\Launchy\Launchy.exe\"" /f
)
if exist "%ProgramFiles%\Launchy\Launchy.exe" (
"%ProgramFiles%\Launchy\Launchy.exe"
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" ^
/v Launchy /t reg_sz /d "\"%ProgramFiles%\Launchy\Launchy.exe\"" /f
)

endlocal

Silent uninstall

@echo off
setlocal EnableDelayedExpansion
set path=%path%;%~dp0
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=Launchy_21344213_is1
tasklist | find "Launchy"
if !errorlevel!==0 "%~dp0pskill.exe" Launchy.exe
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
reg query "%sw%\%x%%u%\%k%" > nul 2>&1
if !errorlevel!==0 (
for /f "tokens=*" %%a in ('^
reg query "%sw%\%x%%u%\%k%" /v UninstallString ^|
findstr "UninstallString" ^|
sed "s/UninstallString\|REG_SZ//g" ^|
sed "s/^[ \t]*//g" ^|
sed "s/\d034//g"') do (
start /wait "" %%a /SILENT
)
)
:CheckUninstallKey
reg query "%sw%\%x%%u%\%k%" > nul 2>&1
if !errorlevel!==0 goto CheckUninstallKey
endlocal
Files needed to successfully detect uninstall string:
http://gnu.catonrug.net/libiconv2.dll
http://gnu.catonrug.net/libintl3.dll
http://gnu.catonrug.net/regex2.dll
http://gnu.catonrug.net/sed.exe

Setup file:
http://www.launchy.net/downloads/win/Launchy2.5.exe
c67962f064924f3c7b95d69f88e745c0
35d759b445aad11e0692cd6c237f741aebc45305

Thursday, September 24, 2015

Everything silent install-uninstall, detection rule

Silent install

@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=Everything
if "%ProgramFiles(x86)%"=="" goto x86

:x64
echo 64-bit windows detected!
reg query "%sw%\%u%\%k%" > nul 2>&1
if not !errorlevel!==0 (
echo installing 64-bit version..
for /f "tokens=*" %%a in ('^
dir /b "%~dp0Everything*x64*.exe"') do (
start /wait "" "%~dp0%%a" /S
)
) else echo Everything already exists!
goto exit

:x86
echo 32-bit windows detected!
reg query "%sw%\%u%\%k%" > nul 2>&1
if not !errorlevel!==0 (
echo installing 32-bit version
for /f "tokens=*" %%a in ('^
dir /b "%~dp0Everything*x86*.exe"') do (
start /wait "" "%~dp0%%a" /S
)
) else echo Everything already exists!
:exit
endlocal

Silent uninstall

@echo off
setlocal EnableDelayedExpansion
set path=%path%;%~dp0
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=Everything
reg query "%sw%\%u%\%k%" > nul 2>&1
if !errorlevel!==0 (
for /f "tokens=*" %%a in ('^
reg query "%sw%\%u%\%k%" /v UninstallString ^|
findstr "UninstallString" ^|
sed "s/UninstallString\|REG_SZ//g" ^|
sed "s/^[ \t]*//g" ^|
sed "s/\d034//g"') do (
start /wait "" "%%a" /S
)
)
:CheckUninstallKey
reg query "%sw%\%u%\%k%" > nul 2>&1
if !errorlevel!==0 goto CheckUninstallKey
endlocal
Files needed to successfully detect uninstall string:
http://gnu.catonrug.net/libiconv2.dll
http://gnu.catonrug.net/libintl3.dll
http://gnu.catonrug.net/regex2.dll
http://gnu.catonrug.net/sed.exe

Setup files:
http://www.voidtools.com/Everything-1.3.4.686.x64-Setup.exe
e880b644fb867e21125349a53075e1df
351c03981ad400bc68849243fe20670f18a502ec
http://www.voidtools.com/Everything-1.3.4.686.x86-Setup.exe
647e7d61796e54ea2c6c283797674316
42f6331d2308961a52ed3823a10d8def0a1979c9

Wednesday, September 23, 2015

HashMyFiles silent install, Enable Explorer Context Menu, command line


Save these two files:
http://www.nirsoft.net/utils/hashmyfiles.zip
http://www.nirsoft.net/utils/hashmyfiles-x64.zip
It really matters if you use x64 version instead of x86!

Install Context Menu:
if not "%ProgramFiles(x86)%"=="" set x=-x64
"%~dp07z.exe" x "%~dp0hashmyfiles%x%.zip" -o"%systemroot%" -y

reg add "HKCR\*\shell\HashMyFiles\command" ^
/ve /t REG_SZ /d "\"%systemroot%\HashMyFiles.exe\" /file \"%%1\"" /f

reg add "HKCR\Directory\shell\HashMyFiles\command" ^
/ve /t REG_SZ /d "\"%systemroot%\HashMyFiles.exe\" /file \"%%1\"" /f
Uninstall Context Menu:
reg delete "HKCR\*\shell\HashMyFiles" /f
reg delete "HKCR\Directory\shell\HashMyFiles" /f
HashMyFiles home:
http://www.nirsoft.net/utils/hash_my_files.html

Tuesday, September 22, 2015

Backup, delete, restore all PuTTY saved sessions


Open command prompt without "run as administrator"!

Create backup of all saved putty sessions of current user:
reg export "HKCU\SOFTWARE\SimonTatham" "%userprofile%\Desktop\PuTTY.reg"
Delete all settings in current user profile:
reg delete "HKCU\SOFTWARE\SimonTatham" /f
Restore backup in current user profile:
reg import "%userprofile%\Desktop\PuTTY.reg"

Monday, September 21, 2015

Safari 5.1.7 direct link, silent install-uninstall, detection method


Direct link:
SafariSetup.exe
0a5b39a859eb84484d5559a8ba22f736
f601df0106987bfffc3f22b046ba835e4f8d29c6

Silent install:
@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k={C779648B-410E-4BBA-B75B-5815BCEFE71D}
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 "%~dp0Safari*.exe"') do (
"%~dp0%%a" /passive /norestart
)
) else echo Safari already installed!
endlocal
Silent uninstall:
@echo off
setlocal EnableDelayedExpansion
set path=%path%;%~dp0
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k={C779648B-410E-4BBA-B75B-5815BCEFE71D}
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
reg query "%sw%\%x%%u%\%k%" > nul 2>&1
if !errorlevel!==0 (
%systemroot%\system32\msiexec.exe /x %k% /qb
)
:CheckUninstallKey
reg query "%sw%\%x%%u%\%k%" > nul 2>&1
if !errorlevel!==0 goto CheckUninstallKey
endlocal

Sunday, September 20, 2015

KeePass 1 silent uninstall

silent-uninstall.cmd
@echo off set sw=HKLM\SOFTWARE set u=Microsoft\Windows\CurrentVersion\Uninstall set k=KeePass Password Safe_is1 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" /SILENT )
Related:
http://sourceforge.net/projects/keepass/files/KeePass%201.x/

Friday, September 18, 2015

PuTTY silent install-uninstall, detection rule
Remove saved sessions and random seed file?

PuTTY silent install with detection rule:
@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=PuTTY_is1
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 "%~dp0putty*installer.exe"') do (
"%~dp0%%a" /SILENT
)
) else echo Putty already installed!
endlocal
PuTTY silent uninstall:
When you uninstall putty you have to deal with all saved information:

As an workaround it is possibe to manual:
1) kill existing putty instance
2) delete putty registry uninstall key
3) remove all shortcuts under start menu
4) remove putty directory under program files
5) delete settings under current user profile
@echo off
setlocal EnableDelayedExpansion
set path=%path%;%~dp0
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=PuTTY_is1

tasklist | find "putty"
if !errorlevel!==0 "%~dp0pskill.exe" putty.exe

if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
reg query "%sw%\%x%%u%\%k%" > nul 2>&1
if !errorlevel!==0 reg delete "%sw%\%x%%u%\%k%" /f

if exist "%programdata%\Microsoft\Windows\Start Menu\Programs\PuTTY" (
rd "%programdata%\Microsoft\Windows\Start Menu\Programs\PuTTY" /Q /S
)

if exist "%ProgramFiles(x86)%\PuTTY" rd "%ProgramFiles(x86)%\PuTTY" /Q /S
if exist "%ProgramFiles%\PuTTY" rd "%ProgramFiles%\PuTTY" /Q /S

reg delete "HKCU\SOFTWARE\SimonTatham" /f

endlocal
to deal with existing process i use pskill:
http://live.sysinternals.com/Tools/pskill.exe

Related files:
http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.65-installer.exe
a84d239584cca5c36dcd4faf49f9a877
119261bd53b792e13e7fd27384e86ea960597a7e

Thursday, September 17, 2015

Deluge silent install-uninstall, detection rule

Deluge silent install with detection rule:

@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=Deluge
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 "%~dp0deluge*.exe"') do (
start /wait "" "%~dp0%%a" /S
)
) else echo Deluge is already installed!
endlocal

Deluge silent uninstall:

@echo off
setlocal EnableDelayedExpansion
set path=%path%;%~dp0
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=Deluge
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
reg query "%sw%\%x%%u%\%k%" > nul 2>&1
if !errorlevel!==0 (
for /f "tokens=*" %%a in ('^
reg query "%sw%\%x%%u%\%k%" /v UninstallString ^|
findstr "UninstallString" ^|
sed "s/UninstallString\|REG_SZ//g" ^|
sed "s/^[ \t]*//g" ^|
sed "s/\d034//g"') do (
"%%a" /S
)
)
:CheckUninstallKey
reg query "%sw%\%x%%u%\%k%" > nul 2>&1
if !errorlevel!==0 goto CheckUninstallKey
endlocal
Check for latest version:
http://download.deluge-torrent.org/windows/?C=M;O=D

Wednesday, September 16, 2015

TightVNC silent install-uninstall, detection rule

silent-install.cmd
@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k={D2372F87-7DA2-47F7-A102-AF2181B8EAA2}
if "%ProgramFiles(x86)%"=="" goto x86

:x64
echo 64-bit windows detected!
reg query "%sw%\%u%\%k%" > nul 2>&1
if not !errorlevel!==0 (
echo installing 64-bit version..
for /f "tokens=*" %%a in ('^
dir /b "%~dp0tightvnc*.msi" ^|
find "64bit"') do (
%systemroot%\system32\msiexec.exe /i "%~dp0%%a" /qb ADDLOCAL="Viewer"
)
) else echo TightVNC already exists!
goto exit

:x86
echo 32-bit windows detected!
reg query "%sw%\%u%\%k%" > nul 2>&1
if not !errorlevel!==0 (
echo installing 32-bit version
for /f "tokens=*" %%a in ('^
dir /b "%~dp0tightvnc*.msi" ^|
find /v "64bit"') do (
%systemroot%\system32\msiexec.exe /i "%~dp0%%a" /qb ADDLOCAL="Viewer"
)
) else echo TightVNC already exists!
:exit
endlocal
silent-uninstall.cmd
@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k={D2372F87-7DA2-47F7-A102-AF2181B8EAA2}
if "%ProgramFiles(x86)%"=="" goto x86

:x64
echo 64-bit windows detected!
reg query "%sw%\%u%\%k%" > nul 2>&1
if !errorlevel!==0 (
echo uninstalling 64-bit version..
for /f "tokens=*" %%a in ('^
dir /b "%~dp0tightvnc*.msi" ^|
find "64bit"') do (
%systemroot%\system32\msiexec.exe /x "%~dp0%%a" /qb
)
) else echo TightVNC not exists!
goto exit

:x86
echo 32-bit windows detected!
reg query "%sw%\%u%\%k%" > nul 2>&1
if not !errorlevel!==0 (
echo uninstalling 32-bit version
for /f "tokens=*" %%a in ('^
dir /b "%~dp0tightvnc*.msi" ^|
find /v "64bit"') do (
%systemroot%\system32\msiexec.exe /x "%~dp0%%a" /qb
)
) else echo TightVNC not exists!
:exit
endlocal
Related:
http://www.tightvnc.com/download.php

http://www.tightvnc.com/download/2.7.10/tightvnc-2.7.10-setup-64bit.msi

349575dc788c24c6c726356d55d3cbaa
d2d76b7e77737de2f9126ecff7f7212b5a7c695e

http://www.tightvnc.com/download/2.7.10/tightvnc-2.7.10-setup-32bit.msi
9f5e660c6bad014c8a0ce5eddf4bb50b
f619e5c7fbc63744ad8606f20ac11d237eabb132

Related:
https://community.spiceworks.com/scripts/show/1836-simple-batch-tightvnc-silent-install

Tuesday, September 15, 2015

comm2.exe, 0xc000022

I have this error starting Commandos 2 on Windows 8.1:

I solve this message by opening Windows Features with command optionalfeatures:

And selected DirectPlay feature:

KeePass 1 silent install

silent-install.cmd
@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=KeePass Password Safe_is1
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 "%~dp0KeePass*.exe"') do (
echo KeePass 2
start /wait "" "%~dp0%%a" /SILENT
)
) else echo KeePass 2 already installed!
endlocal

Related:
http://sourceforge.net/projects/keepass/files/KeePass%201.x/

Ditto silent install-uninstall, detection rule

Ditto silent install with detection rule:

@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=Ditto_is1
if not "%ProgramFiles(x86)%"=="" (
:x64
reg query "%sw%\%u%\%k%" > nul 2>&1
if not !errorlevel!==0 (
for /f "tokens=*" %%a in ('^
dir /b "%~dp0DittoSetup*.exe" ^|
find "64bit"') do (
echo Ditto
"%~dp0%%a" /SILENT
)
) else echo Ditto already exists!
goto exit
)
)
:x86
reg query "%sw%\%u%\%k%" > nul 2>&1
if not !errorlevel!==0 (
for /f "tokens=*" %%a in ('^
dir /b "%~dp0DittoSetup*.exe" ^|
find /v "64bit"') do (
echo Ditto
"%~dp0%%a" /SILENT
)
) else echo Ditto already exists!
:exit
endlocal

Ditto silent uninstall:

@echo off
setlocal EnableDelayedExpansion
set path=%path%;%~dp0
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=Ditto_is1
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
reg query "%sw%\%u%\%k%" > nul 2>&1
if !errorlevel!==0 (
"%~dp0pskill.exe" /accepteula ditto.exe
for /f "tokens=*" %%a in ('^
reg query "%sw%\%u%\%k%" /v UninstallString ^|
findstr "UninstallString" ^|
sed "s/UninstallString\|REG_SZ//g" ^|
sed "s/^[ \t]*//g" ^|
sed "s/\d034//g"') do (
%%a /SILENT
)
)
:CheckUninstallKey
reg query "%sw%\%x%%u%\%k%" > nul 2>&1
if !errorlevel!==0 goto CheckUninstallKey
endlocal
Files needed for uninstall:
http://gnu.catonrug.net/libiconv2.dll
http://gnu.catonrug.net/libintl3.dll
http://gnu.catonrug.net/regex2.dll
http://gnu.catonrug.net/sed.exe
http://live.sysinternals.com/Tools/psexec.exe

Check for latest version:
http://sourceforge.net/projects/ditto-cp/files/Ditto/

Monday, September 14, 2015

Win32DiskImager silent install, detection rule

silent-install.cmd
@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k={D074CE74-912A-4AD3-A0BF-3937D9D01F17}_is1
set n=Win32DiskImager
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 "%~dp0Win32DiskImager*.exe"') do (
echo %n%
start /wait "" "%~dp0%%a" /SILENT
)
) else echo %n% already installed!
endlocal

Sunday, September 13, 2015

/etc/sysconfig/network-scripts/ifcfg-eth0 is missing

If you run ifconfig -a and see that eth0 is right there then you can create this file manually:
vim /etc/sysconfig/network-scripts/ifcfg-eth0
Example for cobbler DHCP server:
DEVICE=eth0
BOOTPROTO=none
IPADDR=192.168.1.5
NETMASK=255.255.255.0
HWADDR=00:1C:25:92:39:C6
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Ethernet
IPV6INIT=no

Friday, September 11, 2015

Thursday, September 10, 2015

Dropbox offline installer, silent install-uninstall, detection rule

Dropbox offline installer Can be found under:
https://www.dropbox.com/downloading?full=1&os=win

Dropbox silent install with detection rule:
dropbox-silent-install.cmd
@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=Dropbox
set f=Dropbox\Client\Dropbox.exe
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
if not exist "%ProgramFiles%\%f%" (
if not exist "%ProgramFiles(x86)%\%f%" (
echo Dropbox not found. Installing..
for /f "tokens=*" %%a in ('dir /b "%~dp0Dropbox*Installer.exe"') do (
start /wait "" "%~dp0%%a" /S
)
)
)
reg query "%sw%\%x%%u%\%k%" /v DisplayVersion | find "DisplayVersion"
endlocal

Remove Dropbox, clean directory and registry:
dropbox-silent-uninstall.cmd
@echo off
setlocal EnableDelayedExpansion

if exist "%ProgramFiles(x86)%\Dropbox\Client\Dropbox.exe" (
echo Dropbox found. Uninstalling..
"%ProgramFiles(x86)%\Dropbox\Client\DropboxUninstaller.exe" /InstallType:MACHINE /S
)

if exist "%ProgramFiles%\Dropbox\Client\Dropbox.exe" (
echo Dropbox found. Uninstalling..
"%ProgramFiles%\Dropbox\Client\DropboxUninstaller.exe" /InstallType:MACHINE /S
)

if exist "%ProgramFiles%\Dropbox" (
echo Removing "%ProgramFiles%\Dropbox" directory..
rd "%ProgramFiles%\Dropbox" /Q /S
)

if exist "%ProgramFiles(x86)%\Dropbox" (
echo Removing "%ProgramFiles(x86)%\Dropbox" directory..
rd "%ProgramFiles(x86)%\Dropbox" /Q /S
)

set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k=Dropbox
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
reg query "%sw%\%x%%u%\%k%" > nul 2>&1
if !errorlevel!==0 (
echo Deleting %k% registry key..
reg delete "%sw%\%x%%u%\%k%" /f
)

echo Detecting Dropbox updater
reg query "%sw%\%x%%u%\{099218A5-A723-43DC-8DB5-6173656A1E94}" > nul 2>&1
if !errorlevel!==0 (
echo Uninstalling Dropbox updater
%systemroot%\system32\msiexec.exe /X {099218A5-A723-43DC-8DB5-6173656A1E94} /qn
) else echo Dropbox updater not found!

endlocal

Wednesday, September 9, 2015

Install .NET Framework 3.5 on Windows 10

Get your Windows 10 installation DISK or ISO file.
Open command prompt in "Run as administrator" mode.
Run command:
dism /online /enable-feature /featurename:NetFX3 /Source:d:\sources\sxs /LimitAccess
d: drive is the drive for dvd rom or usb flash.

This will output:
C:\Windows\system32>dism /online /enable-feature /featurename:NetFX3 /Source:d:\sources\sxs /LimitAccess

Deployment Image Servicing and Management tool
Version: 10.0.10240.16384

Image Version: 10.0.10240.16384

Enabling feature(s)
[==========================100.0%==========================]
The operation completed successfully.
Check out:
Detect .NET Framework versions

Sunday, September 6, 2015

Duplicate room list in Outlook 2010 / 2013

To solve this case remove RoomFinderRecentRoomList key under HKCU:
reg delete "HKCU\Software\Microsoft\Office\15.0\Outlook\Preferences" /v RoomFinderRecentRoomList /f > nul 2>&1
reg delete "HKCU\Software\Microsoft\Office\14.0\Outlook\Preferences" /v RoomFinderRecentRoomList /f > nul 2>&1

Thursday, September 3, 2015

JRE latest install-uninstall, set it and forget

re-new-jre.cmd
@echo off
set http_proxy=
setlocal EnableDelayedExpansion
set path=%path%;%~dp0

del "%~dp0*i586.exe" /Q /F
del "%~dp0*x64.exe" /Q /F

for /f "tokens=*" %%l in ('^
wget --no-cookies --no-check-certificate http://www.java.com/en/download/manual.jsp -qO- ^|
grep BundleId ^|
sed "s/\d034/\n/g" ^|
grep "^http" ^|
gnusort ^|
uniq') do (
echo looking for exe installer under %%l
wget %%l -S --spider -o "%~dp0jretmp.log"
sed "s/http/\nhttp/g;s/exe/exe\n/g" "%~dp0jretmp.log" |^
grep "^http.*x64.exe$\|^http.*i586.exe$" |^
gnusort | uniq | grep "^http.*x64.exe$\|^http.*i586.exe$"
if !errorlevel!==0 (
for /f "tokens=*" %%f in ('^
sed "s/http/\nhttp/g;s/exe/exe\n/g" "%~dp0jretmp.log" ^|
grep "^http.*x64.exe$\|^http.*i586.exe$" ^|
gnusort ^|
uniq ^|
sed "s/^.*\///g"') do (
wget --no-cookies --no-check-certificate %%l -O "%~dp0%%f"
)
)
)

rem https://docs.oracle.com/javase/8/docs/technotes/guides/install/config.html#installing_with_config_file
if not "%ProgramFiles(x86)%"=="" (
for /f "delims=" %%f in ('dir /b "%~dp0jre*x64.exe"') DO (
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 (
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
)

net stop JavaQuickStarterService > nul 2>&1
sc delete JavaQuickStarterService > nul 2>&1
msiexec /x {4A03706F-666A-4037-7777-5F2748764D10} /qn > nul 2>&1

endlocal
uninstall-all-java.cmd
@echo off
"%~dp0nircmd.exe" killprocess javaw.exe
"%~dp0nircmd.exe" killprocess javaws.exe
net stop JavaQuickStarterService
rem sc delete JavaQuickStarterService
wmic product where "name like 'Java%%'" call uninstall
if exist "%programfiles%\Java" rd "%programfiles%\Java" /Q /S
if exist "%programfiles(x86)%\Java" rd "%programfiles(x86)%\Java" /Q /S
Necessarie libraries:
http://gnu.catonrug.net/gnusort.exe
http://gnu.catonrug.net/grep.exe
http://gnu.catonrug.net/libiconv2.dll
http://gnu.catonrug.net/libintl3.dll
http://gnu.catonrug.net/nircmd.exe
http://gnu.catonrug.net/regex2.dll
http://gnu.catonrug.net/sed.exe
http://gnu.catonrug.net/uniq.exe
http://gnu.catonrug.net/wget.exe

Blog Archive