Thursday, March 31, 2016

Uncheck "Automatically detect settings", Internet Explorer


This Visual Basic script will uncheck the option:
create file IEautomaticallydetect.vbs with content:
'Example use of IEautomaticallydetect
IEautomaticallydetect  "off"
'IEautomaticallydetect  "show"
'IEautomaticallydetect  "on"
'IEautomaticallydetect  "show"
wscript.quit

SUB IEautomaticallydetect (status)

DIM sKey,sValue,binaryVal
Dim oReg
Set oReg=GetObject( "winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")    'For registry operations througout

Const HKCU=&H80000001

sKey = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections"
sValue = "DefaultConnectionSettings"

oReg.GetBinaryValue HKCU, sKey, sValue, binaryVal
 
select case lcase(status)
case "on"    binaryVal(8) = binaryVal(8) OR 8        'Force Autodetect on
case "off"    binaryVal(8) = binaryVal(8) XOR 8        'Force Autodetect off
case "show"    wscript.echo "Automatically detect is set to " & ((binaryVal(8) and 8) = 8)
case else    wscript.echo "Invalid parameter - IEautomaticallydetect  on, off or show"
end select

if lcase(status)="on" or lcase(status)="off" then oReg.SetBinaryValue HKCU, sKey, sValue, binaryVal

end sub
Create anothe file uncheck-automatically-detect-settings-ie.cmd with content:
cscript "%~dp0IEautomaticallydetect.vbs"

Wednesday, March 30, 2016

Show MySQL database size, Zabbix

Folowing Raspberry Pi as Zabbix Server or Zabbix 3.0.0 appliance for Raspberry Pi it is nice to view details what exactly takes space in MySQL database.

This is such a brialiant way to show how big is your MySQL database:
#download php file to the confiruation directory which is /var/www/html/zabbix/
wget https://github.com/acropia/Zabbix-Database-Size-Calculator/raw/master/size.php -O /var/www/html/zabbix/size.php

#replace /etc/zabbix/web/zabbix.conf.php with /var/www/html/zabbix/conf/zabbix.conf.php
#this will automatically use MySQL database credentials to connect to the database
sed -i "s/\/etc\/zabbix\/web\/zabbix\.conf\.php/\/var\/www\/html\/zabbix\/conf\/zabbix\.conf\.php/g" /var/www/html/zabbix/size.php
Now go to IP address:
http://192.168.88.55/zabbix/size.php
This will show nice summary:

All credits go to:
https://github.com/acropia/Zabbix-Database-Size-Calculator

original size.php content:
<?php
/**
 * Zabbix-Database-Size-Calculator
 *
 * @version 0.1
 * @author Jan Bouma | SoHosted
 */
define('ZBXCALC_VERSION', '0.1');

$historyStoragePeriodDays = 7;
$historyBytesPerRecord = 50; // DO NOT CHANGE
$trendStoragePeriodDays = 365;
$trendBytesPerRecord = 60; // DO NOT CHANGE

function formatBytes($size, $precision = 0) {
 $base = log($size, 1024);
 $suffixes = array('', 'KB', 'MB', 'GB', 'TB');   
 return round(pow(1024, $base - floor($base)), $precision) ." ".$suffixes[floor($base)];
}

if (!file_exists('/etc/zabbix/web/zabbix.conf.php')) {
 echo "Config file <tt>/etc/zabbix/web/zabbix.conf.php</tt> not found!";
 die();
}
include_once('/etc/zabbix/web/zabbix.conf.php');
$dbh = new PDO('mysql:host=localhost;dbname=zabbix', $DB['USER'], $DB['PASSWORD']);
?>
<!DOCTYPE html>
<html lang='en'>
<head>
 <meta charset='UTF-8' />
 <title>Zabbix Database Size Calculator <?=ZBXCALC_VERSION ?></title>
 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</head>
<body>
<div class='container'>
 <h1>Zabbix Database Size Calculator <?=ZBXCALC_VERSION ?></h1>
 <div class='row'>
  <div class='col-lg-8'>
  <h2>Required storage <small>for history &amp; trends</small></h2>
  <p>Each monitored item is saved in de database per refresh rate. The table below lists the required storage for history and trend records.</p>
  <p>The firsti two columns show the actual amount of items and there refresh rate in Zabbix. The formula used to calculate the required storage is: <tt>days * (items / delay) * 24 * 3600 * bytes</tt></p>
  <table class='table table-condensed'>
   <tr>
    <th>Items</th>
    <th>Refresh rate</th>
    <th>Formula</th>
    <th>Records</th>
    <th>Bytes</th>
    <th>Storage</th>
   </tr>
   <tr>
    <th colspan='6'><em>History</em></th>
   </tr>
<?php
$historyTotalBytes = 0;
$historyTotalRecords = 0;
$historyTotalItems = 0;

foreach ($dbh->query('SELECT COUNT(itemid) AS count, delay FROM items GROUP BY delay ORDER BY delay') as $row) {
 $itemCount = $row['count'];
 $itemDelay = $row['delay'];

 $historyTotalItems += $row['count'];
 $historyRecordsRequired = $historyStoragePeriodDays * ($itemCount / $itemDelay) * 24 * 3600;
 $historyTotalRecords += $historyRecordsRequired;
 $historyBytesRequired = $historyRecordsRequired * $historyBytesPerRecord;
 $historyTotalBytes += $historyBytesRequired;
 echo "\t<tr>\n"
  ."\t\t<td class='text-right'>".$itemCount."</td>\n"
  ."\t\t<td>".$itemDelay."</td>\n"
  ."\t\t<td>".$historyStoragePeriodDays." &times; (".$itemCount." / ".$itemDelay.") &times; 24 &times; 3600 &times; ".$historyBytesPerRecord."</td>\n"
  ."\t\t<td class='text-right'>".$historyRecordsRequired."</td>\n"
  ."\t\t<td class='text-right'>".$historyBytesRequired."</td>\n"
  ."\t\t<td>".formatBytes($historyBytesRequired)."</td>\n"
  ."\t</tr>\n";
}
?>
   <tr class='active'>
    <td colspan='3' class='text-right'>Total history</td>
    <td class='text-right'><?php echo $historyTotalRecords ?></td>
    <td class='text-right'><?php echo $historyTotalBytes ?></td>
    <td><?php echo formatBytes($historyTotalBytes) ?></td>
   </tr>
<?php
$trendRecordsRequired = $trendStoragePeriodDays * ($historyTotalItems / 3600) * 24 * 3600;
$trendBytesRequired = $trendRecordsRequired * 60;
$trendGigabytesCount = $trendBytesRequired / 1024 / 1024 / 1024;
?>
   <tr>
    <th colspan='6'><em>Trends</em></th>
   </tr>
<?php
echo "\t<tr>\n"
 ."\t\t<td class='text-right'>".$historyTotalItems."</td>\n"
 ."\t\t<td>3600</td>\n"
 ."\t\t<td>".$trendStoragePeriodDays." &times; (".$historyTotalItems." / 3600) &times; 24 &times; 3600 &times; ".$trendBytesPerRecord."</td>\n"
 ."\t\t<td class='text-right'>".$trendRecordsRequired."</td>\n"
 ."\t\t<td class='text-right'>".$trendBytesRequired."</td>\n"
 ."\t\t<td>".formatBytes($trendBytesRequired)."</td>\n"
 ."\t</tr>\n";
?>
   <tr class='active'>
    <td colspan='3' class='text-right'>Total history + trends</td>
    <td class='text-right'><?php echo $historyTotalRecords + $trendRecordsRequired ?></td>
    <td class='text-right'><?php echo $historyTotalBytes + $trendBytesRequired ?></td>
    <td><?php echo formatBytes(($historyTotalBytes + $trendBytesRequired)) ?></td>
   </tr>
  </table>


<h2>Database table size <small>actual table status</small></h2>
<p>This table lists the actual table size of the Zabbix database tables</p>
<table class='table table-condensed'>
 <tr>
  <th>Table</th>
  <th>Data length</th>
  <th>Index length</th>
  <th>Data free</th>
  <th>Total</th>
  <th>Total GB</th>
 </tr>
<?php
$tables = array(
 'events',
 'history',
 'history_log',
 'history_str',
 'history_text',
 'history_uint',
 'trends',
 'trends_uint',
);

foreach ($dbh->query('SHOW TABLE STATUS') as $row) {
 if (!in_array($row['Name'],$tables)) {
  continue;
 }

 $tableData = $row['Data_length'];
 $tableIndex = $row['Index_length'];
 $tableFree = $row['Data_free'];
 $tableTotal = $tableData + $tableIndex + $tableFree;
 $tableTotalGB = $tableTotal / 1024 / 1024 / 1024;
 
 echo "\t<tr>\n"
  ."\t\t<td>".$row['Name']."</td>\n"
  ."\t\t<td class='text-right'>".$tableData."</td>\n"
  ."\t\t<td class='text-right'>".$tableIndex."</td>\n"
  ."\t\t<td class='text-right'>".$tableFree."</td>\n"
  ."\t\t<td class='text-right'>".$tableTotal."</td>\n"
  ."\t\t<td class='text-right'>".formatBytes($tableTotal)."</td>\n"
  ."\t</tr>\n";
}
?>
   </table> 
  </div><!--col-lg-8-->
  <div class='col-lg-4'>
   <h2>Variables</h2>
   <p>Variables used to calculate the required storage</p>
   <div class='panel panel-default'>
    <table class='table table-condensed'>
     <tr>
      <td>History storage period:</td>
      <td><?php echo $historyStoragePeriodDays; ?></td>
     </tr>
     <tr>
      <td>Trend storage period:</td>
      <td><?php echo $trendStoragePeriodDays; ?></td>
     </tr>
     <tr>
      <td>History bytes per record:</td>
      <td><?php echo $historyBytesPerRecord; ?></td>
     </tr>
     <tr>
      <td>Trend bytes per record:</td>
      <td><?php echo $trendBytesPerRecord; ?></td>
     </tr>
    </table>
   </div>
  </div><!--col-lg-4-->
 </div><!--row-->
 <footer>
  <hr />
  <address>
   <strong>Author: Jan Bouma (acropia)</strong><br />
   GitHub repo: <a href='https://github.com/acropia/Zabbix-Database-Size-Calculator' target='_blank'>https://github.com/acropia/Zabbix-Database-Size-Calculator</a>
  </address>
 </footer>
</div><!--container-->
</body>
</html>

Tuesday, March 29, 2016

Install Google Chrome on CentOS 7

Move to the root account:
sudo su
Add repository:
cat > /etc/yum.repos.d/google-chrome.repo <<EOT
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
EOT
Check if there is any Google Chrome version available now:
yum info google-chrome-stable
This will report something like:
Name        : google-chrome-stable
Arch        : x86_64
Version     : 49.0.2623.110
Release     : 1
Size        : 46 M
Repo        : google-chrome/x86_64
Summary     : Google Chrome
URL         : https://chrome.google.com/
License     : Multiple, see https://chrome.google.com/
Description : The web browser from Google
Install Google Chrome:
yum install google-chrome-stable -y

Sunday, March 27, 2016

Error 7054 - The system has reached its licensed logon limit


I am trying to romote control user session in Windows Server 2008 R2.
I have Windows Server 2012 domain controller which host licensing server.

Turns out it is possible to control user session with another Windows 2008 R2 server using "Remote Desktop Session manager":

If you find this useful and you do not leave a comment then you will die.

If this was not helpful do not worry. You will live a very healthy life ;)

Monday, March 21, 2016

Set default registry keys in HKCU new user profile

I were using this method back in reduce ntuser.dat but this is such a big deal for new post.

I have this problem in Windows Server 2008 R2:
I have configured application to run at user startup.
This means that explorer.exe is not loaded which cause very weird color theme in new user profile.

To solve this situation you have to backup color pattern which you are satisfied with:
reg export "HKCU\Control Panel\Colors" "%userprofile%\Desktop\colors.reg"
Now lets modify new user default registry package:
Backup:
C:\Users\Default\NTUSER.DAT
Open regedit in "Run As Administrator" mode.

Select HKEY_LOCAL_MACHINE:

Go for [File] -> [Load Hive...]

Select C:\Users\Default\NTUSER.DAT

Set name like pillow

Now the pillow is loaded:

Go to Colors section and select [Copy Key Name]

Open colors.reg in notepad and replace:
HKEY_CURRENT_USER\Control Panel\Colors
with your key value for example:
HKEY_LOCAL_MACHINE\pillow\Control Panel\Colors
Remember to keep the square brackets! Save the file! At the end file looks like:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\pillow\Control Panel\Colors]
"Background"="58 110 165"
"Scrollbar"="212 208 200"
"ActiveTitle"="10 36 106"
"InactiveTitle"="128 128 128"
"Menu"="212 208 200"
"Window"="255 255 255"
"WindowFrame"="0 0 0"
"MenuText"="0 0 0"
"WindowText"="0 0 0"
"TitleText"="255 255 255"
"ActiveBorder"="212 208 200"
"InactiveBorder"="212 208 200"
"AppWorkspace"="128 128 128"
"Hilight"="10 36 106"
"HilightText"="255 255 255"
"ButtonFace"="212 208 200"
"ButtonShadow"="128 128 128"
"GrayText"="128 128 128"
"ButtonText"="0 0 0"
"InactiveTitleText"="212 208 200"
"ButtonHilight"="255 255 255"
"ButtonDkShadow"="64 64 64"
"ButtonLight"="212 208 200"
"InfoText"="0 0 0"
"InfoWindow"="255 255 225"
"ButtonAlternateFace"="181 181 181"
"HotTrackingColor"="0 0 128"
"GradientActiveTitle"="166 202 240"
"GradientInactiveTitle"="192 192 192"
"MenuHilight"="10 36 106"
"MenuBar"="212 208 200"
Now go [File] -> [Import...] and select colors.reg
Make sure something has been imported:

Select again pillow and go for [File] -> [Unload Hive...]

Delete all old user from computer:
http://gnu.catonrug.net/delprof.exe
use "Run As Administrator" mode.

Friday, March 18, 2016

Integrate Proxy Settings, Windows Server 2008 R2

I did not found option to integrate proxy settings via group policy for Windows Server 2008 R2. As an workaround i found that there is a tool to create windows explorer 11 custom installation and you can set this option there.

To work with this solution:

Download Internet Explorer Administration Kit 10 (IEAK 10)

http://download.microsoft.com/download/A/B/1/AB1954BF-8B20-4F01-808A-FE5EE5269F08/MSI/en-us/ieak.msi
4ab5e3de03f23b384d7184e89ed843da
0115afd586c82ca0de573d9dbfe042db66540392

Now open:
Start -> All Programms -> Windows IEAK 11 ->
Internet Explorer Customization Wizard 11

Folowing on screen instructions you have to select which kind of package you want to create:

Let the wizard know that there can be situation that internet explorer 11 is already installed and in this case you want to only push the settings:

If you really want to only integrate proxy settings then just select "Connection Customization":

Press "Synchronize" to download internet explorer source files:

And finally you open internet explorer dialog:

Goto "Lan settings":

You can only set the lan settings:

After all go to your C:\builds\DDMMYYYY\BrndOnly\AMD64_WIN7\EN-US and you got files:
IE11-Setup-Branding.exe
IE11-Setup-Branding.msi
Use msi file to deploy settings:
%systemroot%\system32\msiexec.exe /i IE11-Setup-Branding.msi /qb
Related:
https://technet.microsoft.com/en-us/browser/bb219517

Thursday, March 17, 2016

Tuesday, March 15, 2016

if comparing float, linux shell, awk

if a is greater than b:
#!/bin/sh
a=$(echo "6.3")
b=$(echo "5.95")
var=$(awk 'BEGIN{ print "'$b'"<"'$a'" }')
if [ "$var" -eq 1 ]; then
echo $a is greater than $b
else
echo $b is greater then $a
fi
if b is greater than a:
#!/bin/sh
a=$(echo "16.3")
b=$(echo "25.95")
var=$(awk 'BEGIN{ print "'$b'"<"'$a'" }')
if [ "$var" -eq 1 ]; then
echo $a is greater than $b
else
echo $b is greater then $a
fi
if b and a is equal:
#!/bin/sh
a=$(echo "6.3")
b=$(echo "6.3")
var=$(awk 'BEGIN{ print "'$b'"=="'$a'" }')
if [ "$var" -eq 0 ]; then
echo $a and $b is different
else
echo $b and $a is equal
fi

Monday, March 14, 2016

32-bit Office 2013 quick deployment guide

Before you work with this scenario
make sure this key exists on computer where office is installed:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Office15.PROPLUS
or:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Office15.PROPLUS
Lauch setup.exe /admin and create your administrative profile.
Save the profile as silent.msp in directory where setup.exe is having a good time.

office 2013 x86 silent install using administrative msp file

silent-install.cmd
@echo off
setlocal EnableDelayedExpansion
set proplus=Office15.PROPLUS
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall

if not "%ProgramFiles(x86)%"=="" (
reg query %sw%\Wow6432Node\%u%\%proplus% > nul 2>&1
if !errorlevel!==0 (
echo 32-bit office detected on 64-bit windows
goto exit
)
)

reg query %sw%\%u%\%proplus% > nul 2>&1
if !errorlevel!==0 (
echo native office detected based on windows architecture
goto exit
)

echo installing 32-bit office..
start /wait "" "%~dp0setup.exe" /adminfile "%~dp0silent.msp"
reg add "HKCU\Software\Microsoft\Office\15.0\Common\General" /v shownfirstrunoptin /t REG_DWORD /d 1 /f > nul 2>&1
reg add "HKCU\Software\Microsoft\Office\15.0\FirstRun" /v BootedRTM /t REG_DWORD /d 1 /f > nul 2>&1
reg add "HKCU\Software\Microsoft\Office\15.0\FirstRun" /v disablemovie /t REG_DWORD /d 1 /f > nul 2>&1
reg add "HKCU\Software\Microsoft\Office\15.0\Common\PTWatson" /v PTWOptIn /t REG_DWORD /d 1 /f > nul 2>&1
reg add "HKCU\Software\Microsoft\Office\15.0\Common" /v qmenable /t REG_DWORD /d 1 /f > nul 2>&1

:exit
endlocal

office 2013 x86 silent uninstall using xml file

silent-uninstall.cmd
@echo off
setlocal EnableDelayedExpansion
set proplus=Office15.PROPLUS
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall

if not "%ProgramFiles(x86)%"=="" (
reg query %sw%\Wow6432Node\%u%\%proplus% > nul 2>&1
if !errorlevel!==0 (
echo 32-bit office detected on 64-bit windows
goto uninstall
)
)

reg query %sw%\%u%\%proplus% > nul 2>&1
if !errorlevel!==0 (
echo native office detected based on windows architecture
goto exit
)

goto exit

:uninstall
echo uninstalling 32-bit office..
start /wait "" "%~dp0setup.exe" /uninstall ProPlus /config "%~dp0ProPlusUninstall.xml"

:exit
endlocal
ProPlusUninstall.xml
<Configuration Product="ProPlus">
<Display Level="none" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" />
<Setting Id="SETUP_REBOOT" Value="AutoAlways" />
</Configuration>

Thursday, March 10, 2016

Monday, March 7, 2016

Midori Browser acts like Safari on Mac OS X

To prevent this thing to happen it is possible to use these other options:
midori -e identify-as=MIDORI_IDENT_FIREFOX
midori -e identify-as=MIDORI_IDENT_CHROME
midori -e identify-as=MIDORI_IDENT_EXPLORER

Saturday, March 5, 2016

SumatraPDF new version detect

Today i am creating a version detect for SumatraPDF.
I do not use this application very often but my wife use it for ePub books.

This is first time when i look for content into javascript file.
For example the latest version number of SumatraPDF can be found under:
http://www.sumatrapdfreader.org/sumatra.js

Every file are hosted with base url:
https://kjkpub.s3.amazonaws.com/sumatrapdf/rel/SumatraPDF-
Then comes version number like 3.1.1.

At the end the url file is completed with four other scenarious like:
-install.exe
-64-install.exe
.zip
-64.zip
So at the end we got these links:
https://kjkpub.s3.amazonaws.com/sumatrapdf/rel/SumatraPDF-3.1.1-install.exe
https://kjkpub.s3.amazonaws.com/sumatrapdf/rel/SumatraPDF-3.1.1-64-install.exe
https://kjkpub.s3.amazonaws.com/sumatrapdf/rel/SumatraPDF-3.1.1.zip
https://kjkpub.s3.amazonaws.com/sumatrapdf/rel/SumatraPDF-3.1.1-64.zip
The whole project can be found under:
https://github.com/catonrug/sumatrapdf-detect/blob/master/check.sh

And the result of course under:
http://dl4ou.blogspot.com/

Friday, March 4, 2016

Midori socks proxy, tor, tsocks, Raspberry Pi

I was struggling this for a while. By default Midori was not option to use socks5 proxy option. I needed this option so i can connect to the tor network which usually is at port 9050. This solution actually uses socks4.

This is tested on fresh 2016-02-26-raspbian-jessie.img.

Move to the super user:
sudo su
Update system:
apt-get update -y && apt-get upgrade -y
Install tsocks tunnel future:
apt-get install tsocks -y
Configure tsocks to use default tor port:
cat > /etc/tsocks.conf <<EOT
server = 127.0.0.1
server_port = 9050
local = 127.0.0.0/255.128.0.0
local = 127.128.0.0/255.192.0.0
EOT
Add user pi to tor group. This is required for unattended install:
sed -ri '$adebian-tor:x:111:pi' /etc/group
Install tor network:
apt-get install vidalia -y
Install Midori web browser:
apt-get install midori -y
To execute midori with tor network use:
tsocks midori -a http://www.catonrug.net/
Related:
https://wiki.xfce.org/midori/faq

Thursday, March 3, 2016

MAC address exception, Windows, command line

Today i want to limit script execution based on client MAC address.

I use gnu grep for more production and less code.
grep.exe

This is how i found MAC address for active interface.
Change the basic octets to satisfy your needs:
for /f "tokens=12 delims= " %%a in ('^
ipconfig -all ^|
"%~dp0grep.exe" -m1 -B6 "IPv4 Address.*192\.168\.[0-9]\+\." ^|
"%~dp0grep.exe" "Physical Address"') do (
echo %%a
)
And now the limitation:
I create a file exeption-list.txt with content:
12-12-ab-ab-ac-ac
11-22-33-44-55-66
ff-ee-aa-cc-dd-bb
And the final script for production:
setlocal EnableDelayedExpansion
for /f "tokens=12 delims= " %%a in ('^
ipconfig -all ^|
"%~dp0grep.exe" -m1 -B6 "IPv4 Address.*192\.168\.[0-9]\+\." ^|
"%~dp0grep.exe" "Physical Address"') do (
type "%~dp0exeption-list.txt" | find "%%a"
if !errorlevel!==0 echo MAC found
)
endlocal

Wednesday, March 2, 2016

Remove PDFCreator 2 welcome screen

I have made universal script to remove PDFCreator welcome screen:

user-startup-script.cmd - this script must be execute with simple user permission.
@echo off
setlocal EnableDelayedExpansion
set path=%path%;%~dp0
set program=HKLM\SOFTWARE\pdfforge\PDFCreator\Program

echo Checking if PDFCreator is even installed..
reg query "%program%" > nul 2>&1

if !errorlevel!==0 (
echo.
echo PDFCreator found. Reading the version now..

reg query "%program%" /v ApplicationVersion |^
sed "s/^.*REG_SZ[ \t]*//" |^
grep -v "[a-zA-Z]" |^
grep "[0-9\.]\+"

if !errorlevel!==0 (
echo.
echo Reading version and format value for welcome key..

for /f "tokens=*" %%a in ('^
reg query "%program%" /v ApplicationVersion ^|
sed "s/^.*REG_SZ[ \t]*//" ^|
grep -v "[a-zA-Z]" ^|
grep "[0-9\.]\+" ^|
sed "s/^/v/;s/\./ Build /3"') do (

echo.
echo Inserting value in current user profile..

reg add "HKCU\Software\pdfforge\PDFCreator" ^
/v LatestWelcomeVersion /t REG_SZ /d "%%a" /f > nul 2>&1
if !errorlevel!==0 echo Done.
echo.
)

)

)
endlocal
This is tested and works on versions:
2.2.0
2.2.1
2.2.2
2.3.0
This is tested and not works on version 2.1.2 cause it keeps the settings under:
HKCU\Software\PDFCreator.net
All together:
https://github.com/catonrug/remove-pdfcreator-2-welcome-screen-hkcu/archive/master.zip

Lets see how long this works!

Blog Archive