Table of Contents |
---|
{
*nix
Grep
grep '^a.*e$' file
...
No Format |
---|
If Exist C:\Windows\SysWOW64 ( GOTO x64 ) ELSE ( GOTO x86 ) :x64 do some stuff GOTO END :x86 do some stuff GOTO END :END |
Converting to gpt
...
CMD:
Diskpart
select disk 0
...
Initialize-Disk -Number 0 -PartitionStyle GPT
Getting System Info
Detecting Windows Version
CMD:
ver | find "6.3" >nul && goto WIN8
...
Get-WindowsEdition -Verbose -Online
Detecting Hardware Model
if /i "%WMICModel:~0,7%"=="20074DU" set TP=y
...
Using 7-Zip to Unzip to a directory
...
"%~dp07za.exe" x -y -o"C:\Program Files (x86)\NotePadPlusPlus" "%~dp0npp.6.6.6.bin.7z"
...
No Format |
---|
If Exist C:\Windows\SysWOW64 ( do some stuff for 64-bit Windows ) ELSE ( do some other stuff for 32-bit Windows ) |
Powershell:
...
No Format |
---|
$x = Get-WmiObject win32_operatingsystem if( $x.OSArchitecture -eq "64-bit") { do stuff in 64-bit Windows } else { do some stuff in 32-bit Windows } |
...
Getting to the Native cmd prompt
No Format |
---|
======================================================== @echo off if not exist c:\windows"%windir%\sysnative\cmd.exe" goto :gonenative echo Relaunching with x64 cmd.exe... c:\windows"%windir%\sysnative\cmd.exe" /C "%~dpnx0" goto :EOF :gonenative REM ---paste the rest of your batch code below this line--- ======================================================== |
...
netsh advfirewall firewall add rule name="Google Earth" dir=in action=allow program="C:\Program Files (x86)\Google\Google Earth\client\googleearth.exe"
...
Registry Stuff
Importing into the 64bit Registry
...