Skip to content

Instantly share code, notes, and snippets.

@empjustine
Last active May 20, 2018 02:53
Show Gist options
  • Save empjustine/c0813d79979b5c006fd1d069651151c3 to your computer and use it in GitHub Desktop.
Save empjustine/c0813d79979b5c006fd1d069651151c3 to your computer and use it in GitHub Desktop.
Windows batch files cheatsheet
  • keeps a command console window open

    cmd /k app.exe
    
  • starts an app and waits until it's closed

    start /wait chrome.exe http://google.com
    
  • %1 - first argument, %2 - second, %* - all

  • iterates through the range of numbers starting at 5 by increment of 7 not more than 100

    for /l %%x in (5, 7, 100) do echo %%x
    
sc config wuauserv start= disabled
net stop wuauserv & REM Windows Update
net stop appidsvc
net stop BITS & REM Background Intelligent Transfer Service
net stop UsoSvc & REM Update Orchestrator Service for Windows Update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment