Scripting - GradedJestRisk/windows-training GitHub Wiki

Table of Contents

General

Useful tools:

  • get executable location: where <APP_NAME>

Batch file

Variable

Overview:

  • get values of one variable: ECHO %<VARIABLE_NAME>% , eg: ECHO %PATH%
  • get values of all: SET
  • append SET <VARIABLE_NAME> = %<VARIABLE_NAME>%<VALUE>, eg; <code> SET PATH = %PATH%;%JAVA_HOME%/bin

Environment variable

Overview:

  • get values of one variable: SET <VARIABLE_NAME> , eg: SET PATH
  • get values of all: SET
  • set value inside process: SET <VARIABLE_NAME>=<VARIABLE_VALUE> , eg: SET PATH=C:\WINDOWS
  • set value for all new processes: SET <VARIABLE_NAME> <VARIABLE_VALUE> /M , eg: SETX PATH C:\WINDOWS /M

Powershell

⚠️ **GitHub.com Fallback** ⚠️