web analytics

Windows: get product key

To find the product key for Windows Vista / 7 / 8.x /10, run the following in the command line:

wmic path softwarelicensingservice get OA3xOriginalProductKey

Powershell analog:

powershell “(Get-WmiObject -query ‘select * from SoftwareLicensingService’).OA3xOriginalProductKey”

AutoIt: script for hotkeys usage

This script allows You to define the global Windows hotkeys via the configuration file.

The syntax of the config file is simple:

Hotkey,Program,Parameters

Here “Hotkey” is the combination of the keyboard key with one of the identifiers:

^ Ctrl ! Alt + Shift # Windows-Key

Example:

;Win+C – start calculator […]

WHICH command for DOS

If You need the analog of Unix ‘which’ command and do not have Resource Kit, the following batch file will help. The code was found on www.ss64.com Published with the permission of the author, Clay Calvert.

@echo off SETLOCAL (set WF=) :: Look for file in the current directory for %%a in ("" %!!%) do […]

Start sqlplus in Windows .BAT script

Here is the example of emulating “HERE-documents” in Windows shell.

@ECHO OFF FIND "/*%none% some_label" <%0 |sqlplus USER/PASS@SERVER GOTO end : ———– embedded SQL————————- /* some_label */ select count(*) from dba_free_space; /* some_label */ select tablespace_name from dba_tablespaces; : ———– end of embedded SQL————————- :end

It’s also possible to use procedures in .bat files. %none% […]