{Tutorial} Zander's Batch Tutorials

Discussion in 'Bukkit Tools' started by ZanderMan9, Jul 3, 2014.

Thread Status:
Not open for further replies.
  1. Offline


    Hey everyone, I decided it's time to teach the Bukkit community about the wonders of the Batch language! These tutorials will hopefully keep coming out on a daily basis or even more often. They will all be fairly in-depth, but if you skim them you can get the general points. Well, let's begin, shall we?

    What is Batch?
    Batch is a Windows-exclusive language, meaning you can't use it like Java and go cross-platform. It is specifically for windows, and is not applicable for ANY other operating systems. Sorry, Linux, I love you, but that's for another day...
    You know the stereotypical old computer command prompt? Yeah, that's what you're going to be working with; don't worry, I'm not stuck in the 90's, and we're going to apply some of these things to Bukkit all along the course of these tutorials.
    Batch files have the extension .bat. Windows recognizes this extension as a file to be run in cmd.exe

    You will constantly be working with directories throughout your learning and using of batch. Directories use backslashes, the things above your enter key (most likely) that look like this: \. These separate the names of each folder. Keep in mind that ONLY folders can be used as part of a directory that is not the file you are getting at itself. Explaining this to someone who doesn't know the concept is hard, so here is somewhat of a diagram:
    Dirs contain the files; and of course, this cannot work the other way around, E.G. files cannot contain folders. Or can they? This is where we run into an issue: .zip or .gz or .jar files. These are packed files, or compressed files. This means that they put an extension onto a folder to stop it from being a directory, and therefore can be downloaded and worked with as a whole. These may contain folders in them, but remember the rule: You can't use a file mid-dir. So you have to unpack them in order to utilize the individual folders. This can be done with WinZip or J-zip or 7-zip. Both compressed and uncompressed files have their advantages. Here's the meat of the tutorial, how to apply this knowledge to batch, and in turn, to other things. There are two commands you need:
    cd - This lets you move between folders. The folder you begin at is the folder from which you launched your batch file. There are two ways to use it:
    cd C:\Windows\System32 - this takes you to the dir you specified, regardless of current dir
    (You are currently in C:\)
    cd Windows (You are now in C:\Windows) This one moves you relative to your current dir. To move back up a level:
    cd ..
    dir - This simply lists the files and folders in the current dir
    I hope this is fairly understandable to everyone.

    As of now, this is all I'm going to do. Please like and comment if you are enjoying the tutorials and find them interesting so far. If people really like this, I'm going to do video tutorials. ;)

    Question: I've found a decent recording software for free, but are there any editing softwares out there that are free, and decent too? I want an intro and outro and all that..

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 9, 2016
  2. Offline


    unfortunately I do not have any questions. Read puzzled. You should post more videos for easy understanding
  3. Offline


    I'm trying to get a recording together at the moment. I'll have it posted on youtube by tomorrow at the latest.
Thread Status:
Not open for further replies.

Share This Page