Download installaction package from: https://github.com/PowerShell/Win32-OpenSSH/releases/ Ref: https://serverfault.com/questions/898934/install-openssh-client-in-windows-without-internet-access/1108375#1108375
Category: windows
Collecting User-Mode Dumps for Windows Applications
By the sytem: https://learn.microsoft.com/zh-cn/windows/win32/wer/collecting-user-mode-dumps REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" /v DumpType /t REG_DWORD /d 2 /f REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" /v DumpCount /t REG_DWORD /d 3 /f REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" /v DumpFolder /t REG_EXPAND_SZ /d C:\app\CrashDumps /f By programmatical: https://stackoverflow.com/questions/1547211/how-to-create-minidump-for-my-process-when-it-crashes#1547251
Install Docker EE on Windows Server by Powershell
Enable-WindowsOptionalFeature -Online -FeatureName containers –All Install-Module -Name DockerMsftProvider -Repository PSGallery –Force Install-Package -Name docker -ProviderName DockerMsftProvider –verbose
Suppress console output in PowerShell/Batch
Powershell When exception is occured, Out-Null is actually not worked, so uses Get-ChildItem aaa >$null 2>&1 Or in Powershell 3 Get-ChildItem aaa *>$null Batch/Dos dir aaa >nul 2>&1
Three patterns to use “if else” statement in dos/batch scripts
Pattern #1 @echo off set var=b if "%var%" EQU "a" (echo 1) else if "%var%" EQU "b" ( echo 2) else if "%var%" EQU "c" ( echo 3) Pattern #2 @echo off set var=b if "%var%" EQU "a" ( echo 1 ) else if "%var%" EQU "b" ( echo 2 ) else if "%var%" EQU …
Run application as whatever user called it (non-administrator) on Windows 10 (Supressing UAC Prompts)
cmd min C set __COMPAT_LAYER=RunAsInvoker && start "" %1 For example: @echo off set __COMPAT_LAYER=RunAsInvoker start "" XXX.exe exit /b 0 ref https://stackoverflow.com/questions/37878185/what-does-compat-layer-actually-do
Change user home directory in Windows 10
Open Windows Registry Located at “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\” Find your user SID (such as S-x-x-xxxxxxxxxxxx) Change the value of “ProfileImagePath”
List all Named Pipes in Windows
C:\> dir \\.\pipe\\
Disable Windows Defender Using Windows Registry
Open the Windows Registry Editor. Navigate to the following key (create it if not exists): HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Create a new DWORD (32-bit) item with name DisableAntiSpyware Change its value to 1 Ref: https://www.itechtics.com/enable-disable-windows-defender/