Wednesday, November 27, 2013

How to compile au3 script, AutoIt

Download AutoIt setup file.
http://www.autoitscript.com/files/autoit3/autoit-v3-setup.exe <<== this link always stands for latest version

Start the setup

Select "Use x86 tools by default" to support 32-bit windows systems

If use AutoIt for more for experimenting the i prefer to select "Edit the script" for default option

When setup is done open au3 file and choose Tools -> Build to compile the project.

Close the program and you see the exe file is side by side with source.

Another great way to compile is using right click menu

Mirror of AutoIt version 3.3.8.1 just like in example
https://drive.google.com/file/d/0BxmEiwnrWfmmR0s4dmQ3LXpPems/edit?usp=sharing

Used code in example
RunWait(@ComSpec & ' /c ' & 'reg query "HKLM\SOFTWARE\Microsoft\Internet Explorer" /v Version | find "Version" & pause')

Sunday, November 24, 2013

Friday, November 22, 2013

Create directory structure of installed application

Audit again based on Registry based application audit

I appended the code to create all program names into folders
Into each folder there will be %computername%.log created.
Inside the log file there will be version number of application.

set set l= audit log folder. Usually folder on network - UNC path.
@echo off
setlocal EnableDelayedExpansion
set path=%path%;%~dp0
set l=%~dp0
set u=Microsoft\Windows\CurrentVersion\Uninstall

if "%ProgramFiles(x86)%"=="" (
set sw=HKLM\SOFTWARE
set tokens=7
goto x86 )

:x64
echo 64-BIT APPS:
set sw=HKLM\SOFTWARE
set tokens=7

for /f "tokens=%tokens% delims=\" %%a in ('^
reg query "%sw%\%u%" ^|
grep "CurrentVersion.*Uninstall"') do (
reg query "%sw%\%u%\%%a" /v DisplayName > nul 2>&1
if !errorlevel!==0 (
reg query "%sw%\%u%\%%a" /v DisplayName > nul 2>&1
if !errorlevel!==0 for /f "tokens=*" %%b in ('^
reg query "%sw%\%u%\%%a" /v DisplayName ^|
grep "DisplayName" ^|
sed "s/REG_SZ\|DisplayName//g" ^|
sed "s/^[ \t]*//g"') do if not %%b=="" set name=%%b
reg query "%sw%\%u%\%%a" /v DisplayVersion > nul 2>&1
if !errorlevel!==0 for /f "tokens=*" %%c in ('^
reg query "%sw%\%u%\%%a" /v DisplayVersion ^|
grep "DisplayVersion" ^|
sed "s/REG_SZ\|DisplayVersion//g" ^|
sed "s/^[ \t]*//g"') do if not %%c=="" set version=%%c
echo !name! !version!
if not exist "%l%\!name!" md "%l%\!name!"
echo !version! > "%l%\!name!\%computername%.log"
))

set sw=HKLM\SOFTWARE\Wow6432Node
set tokens=8
echo.
:x86
echo 32-BIT APPS:
for /f "tokens=%tokens% delims=\" %%a in ('^
reg query "%sw%\%u%" ^|
grep "CurrentVersion.*Uninstall"') do (
reg query "%sw%\%u%\%%a" /v DisplayName > nul 2>&1
if !errorlevel!==0 (
reg query "%sw%\%u%\%%a" /v DisplayName > nul 2>&1
if !errorlevel!==0 for /f "tokens=*" %%b in ('^
reg query "%sw%\%u%\%%a" /v DisplayName ^|
grep "DisplayName" ^|
sed "s/REG_SZ\|DisplayName//g" ^|
sed "s/^[ \t]*//g"') do if not %%b=="" set name=%%b
reg query "%sw%\%u%\%%a" /v DisplayVersion > nul 2>&1
if !errorlevel!==0 for /f "tokens=*" %%c in ('^
reg query "%sw%\%u%\%%a" /v DisplayVersion ^|
grep "DisplayVersion" ^|
sed "s/REG_SZ\|DisplayVersion//g" ^|
sed "s/^[ \t]*//g"') do if not %%c=="" set version=%%c
echo !name! !version!
if not exist "%l%\!name!" md "%l%\!name!"
echo !version! > "%l%\!name!\%computername%.log"
))

endlocal

This will completely work out only if run locally.
This will NOT work well from UNC path, user logon script, computer logon script.
The reason is that sed.exe can't find dll libraries in UNC path.

sleep.exe download

sleep.exe is included in
http://download.microsoft.com/download/8/e/c/8ec3a7d8-05b4-440a-a71e-ca3ee25fe057/rktools.exe
mirror: https://drive.google.com/file/d/0BxmEiwnrWfmmY3hBand1aGFuTGs/edit?usp=sharing
a623a99d60f8d34d9fbe089bb64368f2
3f3878ffb2c642e752d811dc05169bfcc2aa97b5

Use 7-zip to extract content from rktools.exe. Use 7-zip again to extract content form rktools.msi

Checksums of sleep.exe
3966fbba168463fd59fbebaace710b1c
14e64246a966327150abf72c68864a3f1867a3e9

Sunday, November 17, 2013

Pet me

Wednesday, November 13, 2013

Deploy Brava Reader, silent install-uninstall

The advantage for Brava Reader is that it can open tiff images on Windows XP machine.

To deploy Brava Reader use msi file.

To get msi file you must launch the original BravaReader.exe setup file which can be downloadable at
Here is mirror: https://drive.google.com/folderview?id=0BxmEiwnrWfmmOF9WQ0o4MHE4cDA&usp=sharing

Launch the setup and wait till this screen appears

Go to %temp% folder and go inside in one of the newest created directory, like {037F1049-A985-48E7-BF4C-AD947CB7E942}.

copy setup.ini, 0x0409.ini and Brava! Reader.msi.
If you can't find the these files then use my files instead
https://drive.google.com/file/d/0BxmEiwnrWfmmSlRYaEtVcjVEUUk/edit?usp=sharing

After you copy the files, now you can cancel the original BravaReader.exe setup.

Rename Brava! Reader.msi to Brava-Reader.msi.

Now in directory where setup.ini, 0x0409.ini and Brava-Reader.msi is having a good time create batch files:
silent-install.cmd
@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k={F692A3C3-8718-448C-9BBF-0186CBB7B7A4}
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
reg query "%sw%\%x%%u%\%k%" > nul 2>&1
if not !errorlevel!==0 (
%systemroot%\system32\msiexec.exe /i "%~dp0Brava-Reader.msi" /qb
)
endlocal
silent-install-for-xp.cmd
@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k={F692A3C3-8718-448C-9BBF-0186CBB7B7A4}
reg query "%sw%\Microsoft\Windows NT\CurrentVersion" /v ProductName |^
find "Windows XP" > nul 2>&1
if !errorlevel!==0 (
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
reg query "%sw%\%x%%u%\%k%" > nul 2>&1
if not !errorlevel!==0 (
%systemroot%\system32\msiexec.exe /i "%~dp0Brava-Reader.msi" /qb
)
endlocal
)
silent-uninstall.cmd
@echo off
setlocal EnableDelayedExpansion
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set k={F692A3C3-8718-448C-9BBF-0186CBB7B7A4}
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
reg query "%sw%\%x%%u%\%k%" > nul 2>&1
if !errorlevel!==0 (
%systemroot%\system32\msiexec.exe /X "%~dp0Brava-Reader.msi" /qb
)
endlocal
Note that product code {F692A3C3-8718-448C-9BBF-0186CBB7B7A4} is for version 7.2.0.72.
For other versions it can be different.

Last one is advanced. This will uninstall all 32-bit applications which contains "Brava" in application name

silent-uninstall-all-brava-products.cmd
@echo off
setlocal EnableDelayedExpansion
set path=%path%;%~dp0
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set n=Brava
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
for /f "tokens=*" %%a in ('^
reg query "%sw%\%x%%u%" /s ^|
grep "Windows.*CurrentVersion.*Uninstall" ^|
sed "s/.*\\Uninstall\\//g"') do (
reg query "%sw%\%x%%u%\%%a" /v DisplayName > nul 2>&1
if !errorlevel!==0 (
reg query "%sw%\%x%%u%\%%a" /v DisplayName | find "%n%"
if !errorlevel!==0 (
echo uninstalling %%a
msiexec /X%%a /qn
)
)
)
endlocal

Sunday, November 10, 2013

Friday, November 8, 2013

Create context menu to print as image pdf


Download SumatraPDF.exe from
http://blog.kowalczyk.info/software/sumatrapdf/download-free-pdf-viewer.html

In directory where SumatraPDF.exe is having a good time create batch files:
install-print-as-image-menu.cmd
reg add "HKCU\Software\Classes\*\shell\Print as Image\command" /ve /t REG_SZ /d "\"%~dp0SumatraPDF.exe\" \"%%1\" -print-to-default -print-settings \"compat\"" /f
Remove this customization
uninstall-print-as-image-menu.cmd
reg delete "HKCU\Software\Classes\*\shell\Print as Image" /f

Thursday, November 7, 2013

List Adobe Reader patches, chronological order, command line

Finally i have to do something awesome.

My previous post about Slipstream patch in Adobe Reader 9, 10 or 11 needed to be updated. Again.

Today's challenge is how to list Adobe Reader patches in correct order cause some patches starts with AdbeRdrSecUpd.. and some with AdbeRdrUpd... When i group these files in alphabetic order the list is sorted wrong and it is bad.

If we have a closer look we can see that all patches ends with and number which symbolize the order in array.
We need to do something.

Here is how i implement list the patches in correct order
@echo off
set path=%path%;%~dp0
for /f "delims=" %%a in ('^
dir /b "%~dp0AdbeRdr*.msp" ^|
sed "s/.*Upd//g" ^|
awk -F ":" "{print $1 | """sort"""}"') DO (
for /f "delims=" %%b in ('dir /b "%~dp0*%%a"') do (
echo %%b
)
)
pause
Some explanations:
For example if we have AdbeRdrUpd11004.msp and AdbeRdrSecUpd11005.msp
The dir /b "%~dp0AdbeRdr*.msp" command will list this patches as
AdbeRdrSecUpd11005.msp
AdbeRdrUpd11004.msp
sed "s/.*Upd//g" will cut all characters from left till "Upd" including "Upd".
11005.msp
11004.msp
awk -F ":" "{print $1 | """sort"""}" will group all numbers alphabetically.
11004.msp
11005.msp
dir /b "%~dp0*%%a" will find back full file name searching by number pattern which now is in correct order.
%%a is line element of array.
AdbeRdrUpd11004.msp
AdbeRdrSecUpd11005.msp
Go to Adobe Reader root section

Monday, November 4, 2013

Single, double, triple click, hold the

A is for "Apple", / B is for "Balloons", / C is for "Crayons", / D is for "Drum"


Single click is for deselect

Double click is for word select

Triple click is for paragraph select or line select


When you double click and hold the second click you can select multiple words


Use triple click and hold the third click to select multiple paragraphs


Try use double click and triple click to next paragraphs:

This is first paragraph. Hello. How are you? Do you like apples?

This is second paragraph. By the way my name is Aigars. I like your style. Use triple click to this paragraph, hold the third click, move to the last paragraph. Did you already use this future?

This is third paragraph. When I get sad, I stop being sad and be awesome instead. True story. Do you like challenges? Have you ever accept any challenge? I accept all kind of challenges. Have you ever met Ted?

h5f91ea#abb drivers for Windows 7 x64

HP Spectre XT drivers for Windows 7 64-bit only:
https://drive.google.com/file/d/
0B9lXbtZ2650KMkxrUWhkZjN1cUk/edit?usp=sharing


Here is install.wim for Windows 7 (64-bit) with all drivers integrated
https://drive.google.com/file/d/
0Byy5khuDVyiMQWRVaWtkSV91bmc/edit?usp=sharing

fbc7c49be7fe3412da3ba8f9bdc1347a
a7db70b5d973e778add2ea6663e8d70bf9c336d6
This install.wim includes drivers for LAN, WLAN, Graphics, USB3, Touchpad, ISCT, IMEI, Cardreader.

Learn how to integrate drivers in install.wim

To overwrite sources\install.wim use
Windows 7 installation media from USB

Sunday, November 3, 2013

Save streaming MMS media to mp3

This method will record streaming media manually to computer instead of downloading it from server.
For 20 minutes media you need 20 minutes to save it.

Here is how to do it:
If don't use VLC media player then you can use portable version for this project.
https://get.videolan.org/vlc/2.0.8/win32/vlc-2.0.8-win32.7z
3d7ff3a21d2a7ac843b202df909462ac
0a65770def0a4f856a72abea30e110930dc85b7d

Somehow i test with version 2.1.0 and then VLC player crashes, so use version 2.0.8

Go Media > Convert / Save ..

Past the url and click convert

Additional screen comes out. Select where to save. Write manually .mp3 file extension.
Select media type. And start.

The time starts go forward. Nothing goes to the speakers ;)

Friday, November 1, 2013

Integrate LAN drivers into install.wim

integrate-drivers.cmd
dism /mount-wim /wimfile:r:\install.wim /index:3 /mountdir:r:\offline
dism /image:r:\offline /add-driver /driver:r:\drivers /recurse
dism /commit-wim /mountdir:r:\offline

Test if DHCP is working on client side, Virtual Lab

This is forth lesson for setting up virtual lab
The first one - setting domain controller and DNS server
Second - create a test user and domain administrator
The third is set up DHCP server in domain controller

Now it is necessary to test if DHCP is actually working on client side

I use addition Windows 7 test machine which i found on http://www.modern.ie/
For another virtual test machines go here

Here is complete OVA file for Windows 7 machine
https://docs.google.com/file/d/0B76gNAvlBE7eUFVCejRNSzZpVXM/edit?usp=sharing
5ea1ddf8de00b95b708dd15aef42e4ee
fddc40334bd3ee2861948140fcba03989645200f

Blog Archive