Skip to content

Instantly share code, notes, and snippets.

@cianb96
Last active December 10, 2015 10:39
Show Gist options
  • Save cianb96/4422827 to your computer and use it in GitHub Desktop.
Save cianb96/4422827 to your computer and use it in GitHub Desktop.
Batch Tips & Tricks

Welcome to my guide for batch mischief! Batch is relatively fun and extremely easy programming language.

Many videos have been posted online showing you a few cool tricks too. Open your horizons and use other sources than this one.

BASIC SYNTAX

You can find all commands and a lot of valuable info using command prompt just if you type help or some_command /? .

I recommend you visit http://ss64.com/nt/ for ALL info.

If you didn't already know, batch files only work on WINDOWS OS and are saved as anything.bat

BATCH BOMBS

Scripts that can be used to freeze a computer by overloading it with commands.

DICLAIMER: I take no responsability for the use of this information by others.

An example would be one where the script opens an endless amount websites because it is in a loop:

@echo off
title Batch Bomb: loop example 1
:a
start www.google.com
goto a

The first line hides your commands in the comand prompt (always useful). The second line defines the title of the window.

The third line sets a sort of header (a pointer - could be called anything, eg. :blraGh) which we can return to using the fifth line. The fourth line starts the default web browser and opens the website www.google.com.

I do not advise you to open this file on your own computer because it will freeze and any open documents will be closed without saving.

In fact, in between :a and goto a, you can input any command that you want the computer to repeat before the "freeze".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment