'''
This file is under the MIT License.

Copyright 2019-2020 <NAME>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files 
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, 
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
'''

# This is the install script.

# Libraries
import os, platform, time, shutil

def cdCheck(directory):
    if(os.path.exists(directory) == True):
        os.chdir(directory)

def rmCheck(directory):
    if(os.path.exists(directory) == True):
        shutil.rmtree(directory)

# First, let's make sure we are running Windows. This install script doesn't work on anything else.
if(platform.system() != "Windows"):
    print("Bash for Windows is only for Windows. It will not be able to\ninstall on", platform.system() + ". Sorry!")

    # Give the user a chance to read the message, then exit
    time.sleep(5)
    exit()

flag = 0

print("Welcome to Bash for Windows!!! \n\"The Bourne Again SHell\" for Windows Setup Wizard!\n\n")
print("This is a piece of software under the MIT License that makes a bash-like\nenviornment under Windows\
 for people who don't want to use WSL or aren't\nable to run WSL.\n")
input("Press Enter to Continue... ")
os.system("cls")
print("\n\n\nThe following is the MIT License. If you do not agree with this license,\ndon't install Bash\
 for Windows.\n\n")
print("Copyright 2019-2020 <NAME>\n\
\n\
Permission is hereby granted, free of charge, to any person obtaining a copy of\n\
this software and associated documentation files (the \"Software\"), to deal in\n\
the Software without restriction, including without limitation the rights to use,\n\
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n\
Software, and to permit persons to whom the Software is furnished to do so,\n\
subject to the following conditions:\n\
\n\
The above copyright notice and this permission notice shall be included in all\n\
copies or substantial portions of the Software.\n\
\n\
THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n\
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n\
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n\
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n\
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
accept = input("Do you accept the license above? [y,N] ")
if((accept == "y") or (accept == "Y")):
    flag = 1
if(flag == 0):
    os.system("cls")
    print("Thanks for your intrest in Bash for Windows. Goodbye!")
    time.sleep(3)
    exit()

time.sleep(1)
os.system("cls")
path = ""
while(True):
    print("Which personal folder do you want to install Bash for Windows into?")
    userName = os.environ.get("USERNAME")
    folder = input("")
    path = "C:\\Users\\" + userName + "\\" + folder
    if(os.path.exists("C:\\Users\\" + userName + "\\" + folder) == True):
        break
    else:
        print("\nFolder,", folder + ", doesn't exist.\n")
path = path + "\\Bash for Windows"
time.sleep(1)
os.system("cls")
print("What kind of Installation do you want?\n")
print("(N)ormal Installation : Full installation with all the code intact")
print("(M)inimal Installation: Only copy over Startup.exe, then continue to setup\nthe User Account\n")
mN = input("[m,N] ")
normalInstall = True
if((mN == "m") or (mN == "M")):
    normalInstall = False
os.system("cls")
print("INSTALLATION SUMMARY:")
print("User Accepted License")
if(normalInstall == False):
    print("Minimal Installation Chosen")
else:
    print("Normal Installation Chosen")
print("Installing Bash for Windows to:", path + "\n")
print("You sure you want to install Bash for Windows")
confirm = input("[y,N] ")
if((confirm == "y") or (confirm == "Y")):
    flag = 2
if(flag != 2):
    print("Thanks for your intrest in Bash for Windows. Goodbye!")
    time.sleep(3)
    exit()
currentDir = os.getcwd()
os.system("cls")
try:
    if(os.path.exists(path) == True):
        print("Bash for Windows Setup Wizard has detected that there is already an install at\n" + path + " .\n")
        confirm = input("Do you want Bash for Windows to overwrite this installation? [y,N] ")
        if((confirm == "y") or (confirm == "Y")):
            try:
                os.chdir(path)
                cdCheck("Bash")
                cdCheck("Bash")
                rmCheck("Users")
                cdCheck("Source")
                rmCheck("Include")
                os.chdir(path)
                cdCheck("Bash")
                cdCheck("Bash")
                rmCheck("Settings")
                rmCheck("Source")
                os.chdir(path + "/..")
                shutil.rmtree(path)
            except PermissionError:
                os.system("cls")
                print("ERROR: Setup cannot delete the old Bash for Windows Installation. It either does")
                print("not have permission to do so or another process is currently using it. Make sure")
                print("that you have permission to do things in this folder and that there isn't already")
                print("a program using this folder, e.g. File Explorer, and start Setup again.")
                input("Press Enter to Continue...")
                os.system("cls")
                print("Bash for Windows Setup Wizard was canceled. Thanks for your intrest! Goodbye!")
                time.sleep(5)
                exit()
        else:
            os.system("cls")
            print("Bash for Windows Setup Wizard was canceled. Thanks for your intrest! Goodbye!")
            time.sleep(5)
            exit()
    os.system("cls")
    print("Installing Bash for Windows. This does not take long.\nIf Installation fails, delete:\n" + path + "\n" + "\
and run setup again. To cancel, hit Ctrl + C.\n")
    time.sleep(1)
    print("Creating Directory Structure...")
    os.chdir(path + "\\..")
    os.mkdir("Bash for Windows")
    os.chdir("Bash for Windows")
    os.mkdir("Bash")
    os.mkdir("Bash/Bash")
    os.mkdir("Bash/Users")
    os.mkdir("Bash/Bash/Settings")
    os.mkdir("Bash/Bash/Source")
    os.mkdir("Bash/Bash/Source/Include")
    os.chdir("Bash/Bash/Source/Include")
    print("Getting ready to write files...")
    includeDir = os.getcwd()
    os.chdir(currentDir)
    if(os.path.exists("Startup.exe") == False):
        print("\nERROR: File \"Startup.exe\" in", currentDir, "\ndoesn't exists. Setup cannot continue.")
        input("Press Enter to Quit Setup...")
        os.system("cls")
        print("Bash for Windows Setup failed. Thanks for your intrest! Goodbye!")
        time.sleep(3)
        exit()
    print("Creating files...")
    runStr = "copy Startup.exe \"" + includeDir + "\" > del.txt"
    os.system(runStr)
    os.remove("del.txt")
    if(normalInstall == True):
        os.chdir(includeDir)
        writeFile = open("bash.py", "w")
        writeFile.write("'''\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files\n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# Bash is the script that handles the commands. Most commands it will call on other scripts to get the job done\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("from time import sleep\n")
        writeFile.write("import os, username, ls, cd, systemvariables, pwd, socket, cat\n")
        writeFile.write("import echo, nano, touch, rm, filechk, cp, pushd, popd, mkdir\n")
        writeFile.write("import mv, oschk, repair, tofile\n\n")
        writeFile.write("# Main function. First Set all other system variables\n")
        writeFile.write("def run():\n")
        writeFile.write("    # Check once again to make sure we are running Windows\n")
        writeFile.write("    oschk.check()\n")
        writeFile.write("    os.chdir(systemvariables.exepath)\n")
        writeFile.write("    os.chdir(\"../../../../\")\n")
        writeFile.write("    systemvariables.ROOT = os.getcwd()\n")
        writeFile.write("    os.chdir(\"Bash/Users/\" + systemvariables.usrsession)\n")
        writeFile.write("    systemvariables.HOME = os.getcwd()\n")
        writeFile.write("    if(os.path.exists(\"Documents\") == False):\n")
        writeFile.write("        print(\"Unfortunatly, Bash for Windows cannot find your documents.\")\n")
        writeFile.write("        prompt = input(\"Do you want to try to repair the problem? [Y,n] \")\n")
        writeFile.write("        if(prompt == \"n\"):\n")
        writeFile.write("            print(\"Abort.\")\n")
        writeFile.write("            systemvariables.USRDOCS = \"null\"\n")
        writeFile.write("        elif(prompt == \"N\"):\n")
        writeFile.write("            print(\"Abort.\")\n")
        writeFile.write("            systemvariables.USRDOCS = \"null\"\n")
        writeFile.write("        else:\n")
        writeFile.write("            success = repair.docs()\n")
        writeFile.write("            if(success == True):\n")
        writeFile.write("                os.chdir(\"Documents\")\n")
        writeFile.write("                systemvariables.USRDOCS = os.getcwd()\n")
        writeFile.write("    else:\n")
        writeFile.write("        os.chdir(\"Documents\")\n")
        writeFile.write("        systemvariables.USRDOCS = os.getcwd()\n")
        writeFile.write("    os.chdir(systemvariables.settingspath)\n")
        writeFile.write("    systemvariables.settingspath = os.getcwd()\n")
        writeFile.write("    os.chdir(\"Settings\")\n")
        writeFile.write("    systemvariables.loginfopath = os.getcwd()\n")
        writeFile.write("    os.chdir(\"../Source\")\n")
        writeFile.write("    systemvariables.srcpath = os.getcwd()\n")
        writeFile.write("    os.chdir(\"../../Users\")\n")
        writeFile.write("    systemvariables.usrpath = os.getcwd()\n")
        writeFile.write("    os.chdir(\"..\")\n")
        writeFile.write("    systemvariables.bshpath = os.getcwd()\n")
        writeFile.write("    zzz = 1\n\n")
        writeFile.write("    # Get user name\n")
        writeFile.write("    cd.go(\"/\")\n")
        writeFile.write("    user = open(\"Bash/Bash/Settings/ivhzadgz.bws\", \"r\")\n")
        writeFile.write("    usr = user.read()\n")
        writeFile.write("    user.close()\n\n")
        writeFile.write("    # Get back to \"Home\" folder\n")
        writeFile.write("    cd.go(\"~\")\n")
        writeFile.write("    # Reset the lastdir variable\n")
        writeFile.write("    systemvariables.lastdir = \"\"\n\n")
        writeFile.write("    # Do this until told to exit\n")
        writeFile.write("    while(zzz == 1):\n")
        writeFile.write("        # Change display depending on where the user is in the file system\n")
        writeFile.write("        if(os.getcwd() == systemvariables.ROOT):\n")
        writeFile.write("            display = \"/\"\n")
        writeFile.write("        elif(os.getcwd() == systemvariables.HOME):\n")
        writeFile.write("            display = \"~\"\n")
        writeFile.write("        elif(os.getcwd() == systemvariables.USRDOCS):\n")
        writeFile.write("            display = \"~/Documents\"\n")
        writeFile.write("        elif(os.getcwd() == systemvariables.settingspath):\n")
        writeFile.write("            display = \"/Bash/Bash\"\n")
        writeFile.write("        elif(os.getcwd() == systemvariables.loginfopath):\n")
        writeFile.write("            display = \"/Bash/Bash/Settings\"\n")
        writeFile.write("        elif(os.getcwd() == systemvariables.srcpath):\n")
        writeFile.write("            display = \"/Bash/Bash/Source\"\n")
        writeFile.write("        elif(os.getcwd() == systemvariables.usrpath):\n")
        writeFile.write("            display = \"/Bash/Users\"\n")
        writeFile.write("        elif(os.getcwd() == systemvariables.exepath):\n")
        writeFile.write("            display = \"/Bash/Bash/Source/Include\"\n")
        writeFile.write("        elif(os.getcwd() == systemvariables.bshpath):\n")
        writeFile.write("            display = \"/Bash\"\n")
        writeFile.write("        else:\n")
        writeFile.write("            display = os.getcwd()\n\n")
        writeFile.write("        # Prompt\n")
        writeFile.write("        command = input(usr + \"@\" + socket.gethostname() + \":\" + display + \" $ \")\n\n")
        writeFile.write("        # Find a space. If one is found, put it in another variable.\n")
        writeFile.write("        args = command.find(\" \", 0, len(command))\n")
        writeFile.write("        argsArr = ['']\n\n")
        writeFile.write("        # Counters\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        j = 0\n")
        writeFile.write("        k = 0\n\n")
        writeFile.write("        # Only do it if there is indeed a space\n")
        writeFile.write("        if(args != -1):\n")
        writeFile.write("            for i in command:\n")
        writeFile.write("                # Only do this after a space\n")
        writeFile.write("                if(j > args):\n")
        writeFile.write("                    # If we come across a space, add an item to the array of arguments and skip the rest\n")
        writeFile.write("                    if(i == \" \"):\n")
        writeFile.write("                        k += 1\n")
        writeFile.write("                        argsArr.append(\"\")\n")
        writeFile.write("                        continue\n\n")
        writeFile.write("                    # Take the current item in the args array and put in each character of the input\n")
        writeFile.write("                    # string, then delete that same character from the input string\n")
        writeFile.write("                    argsArr[k] = argsArr[k] + i\n")
        writeFile.write("                    command = command[0 : j : ]\n")
        writeFile.write("                else:\n")
        writeFile.write("                    j += 1\n")
        writeFile.write("        # Reset the counters\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        j = 0\n")
        writeFile.write("        k = 0\n\n")
        writeFile.write("        # If we have at least 1 space, make sure you take out the last character\n")
        writeFile.write("        # in the command variable that happens to be a space\n")
        writeFile.write("        if(args != -1):\n")
        writeFile.write("            command = command[:-1:]\n\n")
        writeFile.write("        # Run the command. If it dosen't exist, display a message\n")
        writeFile.write("        if(command == \"exit\"):\n")
        writeFile.write("            zzz = 0\n")
        writeFile.write("        elif(command == \"ls\"):\n")
        writeFile.write("            ls.show(argsArr)\n")
        writeFile.write("        elif(command == \"cd\"):\n")
        writeFile.write("            cd.go(argsArr)\n")
        writeFile.write("        elif(command == \"pwd\"):\n")
        writeFile.write("            out = os.getcwd()\n")
        writeFile.write("            flag = 0\n")
        writeFile.write("            if(\">>\" in argsArr):\n")
        writeFile.write("                flag = 1\n")
        writeFile.write("                tofile.write(\">>\", out, argsArr[1])\n")
        writeFile.write("            elif(\">\" in argsArr):\n")
        writeFile.write("                if(flag == 0):\n")
        writeFile.write("                    tofile.write(\">\", out, argsArr[1])\n")
        writeFile.write("            else:\n")
        writeFile.write("                print(out)\n")
        writeFile.write("        elif(command == \"cat\"):\n")
        writeFile.write("            cat.show(argsArr)\n")
        writeFile.write("        elif(command == \"nano\"):\n")
        writeFile.write("            file = argsArr\n")
        writeFile.write("            nano.write(file) \n")
        writeFile.write("        elif(command == \"vi\"):\n")
        writeFile.write("            file = argsArr\n")
        writeFile.write("            nano.write(file) \n")
        writeFile.write("        elif(command == \"vim\"):\n")
        writeFile.write("            file = argsArr\n")
        writeFile.write("            nano.write(file) \n")
        writeFile.write("        elif(command == \"emacs\"):\n")
        writeFile.write("            file = argsArr\n")
        writeFile.write("            nano.write(file) \n")
        writeFile.write("        elif(command == \"clear\"):\n")
        writeFile.write("            os.system(\"cls\")\n")
        writeFile.write("        elif(command == \"lsvar\"):\n")
        writeFile.write("            ls.vars(argsArr)\n")
        writeFile.write("        elif(command == \"echo\"):\n")
        writeFile.write("            echo.reg(argsArr)\n")
        writeFile.write("        elif(command == \"touch\"):\n")
        writeFile.write("            touch.write(argsArr)\n")
        writeFile.write("        elif(command == \"rm\"):\n")
        writeFile.write("            rm.remove(argsArr)\n")
        writeFile.write("        elif(command == \"mv\"):\n")
        writeFile.write("            file = argsArr[0]\n")
        writeFile.write("            dstfile = argsArr[1]\n")
        writeFile.write("            mv.move(file, dstfile)\n")
        writeFile.write("        elif(command == \"cp\"):\n")
        writeFile.write("            file = argsArr[0]\n")
        writeFile.write("            newfile = argsArr[1]\n")
        writeFile.write("            cp.copy(file, newfile)\n")
        writeFile.write("        elif(command == \"pushd\"):\n")
        writeFile.write("            path = argsArr\n")
        writeFile.write("            pushd.go(path)\n")
        writeFile.write("        elif(command == \"popd\"):\n")
        writeFile.write("            popd.go()\n")
        writeFile.write("        elif(command == \"uname\"):\n")
        writeFile.write("            if(argsArr[0] == \"-g\"):\n")
        writeFile.write("                print(\"Bash for Windows: The Bourne Again Shell! Version 1.2.1.1\")\n")
        writeFile.write("                print(\"Taking you to the GitHub page...\")\n")
        writeFile.write("                os.system(\"iexplore https://github.com/JR-Tech-and-Software/Bash-for-Windows\")\n")
        writeFile.write("            else:\n")
        writeFile.write("                print(\"Bash for Windows: The Bourne Again Shell! Version 1.2.1.1\")\n")
        writeFile.write("                print(\"\\nAll the code is avalible at GitHub! Check it out! Use the -g argument\")\n")
        writeFile.write("                print(\"to be taken to the page!\\n\\nBash for Windows is under the MIT License.\")\n")
        writeFile.write("                print(\"Check it out on GitHub as well.\")\n")
        writeFile.write("        elif(command == \"mkdir\"):\n")
        writeFile.write("            mkdir.create(argsArr)\n")
        writeFile.write("        else:\n")
        writeFile.write("            if(command == \"\"):\n")
        writeFile.write("                sleep(0)\n")
        writeFile.write("            else:\n")
        writeFile.write("                if(os.path.exists(os.getcwd() + \"/\" + command) == True):\n")
        writeFile.write("                    typee = argsArr[0]\n")
        writeFile.write("                if(typee == \"exe\"):\n")
        writeFile.write("                    os.system(command)\n")
        writeFile.write("                elif(typee == \"py\"):\n")
        writeFile.write("                    os.system(\"py \" + command)\n")
        writeFile.write("                else:\n")
        writeFile.write("                    print(command + \": command not found\")\n")
        writeFile.write("    exit()\n\n")
        writeFile.write("# More checking for other scripts to use\n")
        writeFile.write("def usrcheck():\n")
        writeFile.write("    incorrect = True\n")
        writeFile.write("    while(incorrect == True):\n")
        writeFile.write("        user = open(\"Settings/ivhzadgz.bws\", \"r\")\n")
        writeFile.write("        userguess = input(\"Type a user name # \")\n")
        writeFile.write("        if(userguess == user.read()):\n")
        writeFile.write("            incorrect = False\n")
        writeFile.write("        else:\n")
        writeFile.write("            print(\"Incorrect Username.\")\n")
        writeFile.write("    user.close()\n")
        writeFile.write("def passcheck():\n")
        writeFile.write("        incorrect = True\n")
        writeFile.write("        while(incorrect == True):\n")
        writeFile.write("            password = open(\"Settings/kvnnadgz.bws\", \"r\")\n")
        writeFile.write("            passguess = input(\"password # \")\n")
        writeFile.write("            if(passguess == password.read()):\n")
        writeFile.write("                incorrect = False\n")
        writeFile.write("            else:\n")
        writeFile.write("                print(\"Incorrect Password.\")\n")
        writeFile.write("        password.close()\n")
        writeFile.write("# If the end user tries to run bash.py without Startup.py, then display this message\n")
        writeFile.write("print(\"This file isn't ment to be run by itself. To run Bash for Windows,\")\n")
        writeFile.write("print(\"run the Startup program.\")\n")
        writeFile.close()
        writeFile = open("cat.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# Cat is a basic script to show the contents of a file\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os, touch, rm, tofile\n\n")
        writeFile.write("# Main Function. First check if the file exists\n")
        writeFile.write("def show(args):\n")
        writeFile.write("    file = args[0]\n")
        writeFile.write("    output = \"\"\n")
        writeFile.write("    firstLetter = \"\"\n")
        writeFile.write("    flag = 0\n\n")
        writeFile.write("    # Make sure the requested file exists and is indeed a file and not a folder.\n")
        writeFile.write("    if(os.path.exists(file) == False):\n")
        writeFile.write("        print(\"cat: \" + file + \" file not found\")\n")
        writeFile.write("    elif(os.path.isdir(file) == True):\n")
        writeFile.write("        print(\"cat: \" + file + \": Is a directory\")\n")
        writeFile.write("    else:\n")
        writeFile.write("        show = open(file)\n")
        writeFile.write("        output = show.read()\n")
        writeFile.write("        show.close()\n")
        writeFile.write("        # If told to do so, either append or overwrite a file where we send all output to\n")
        writeFile.write("        if(\">>\" in args):\n")
        writeFile.write("            i = 0\n")
        writeFile.write("            index = 0\n")
        writeFile.write("            flag = 1\n")
        writeFile.write("            for j in args:\n")
        writeFile.write("                if(i == 0):\n")
        writeFile.write("                    i += 1\n")
        writeFile.write("                    continue\n")
        writeFile.write("                if(args[i] == \">>\"):\n")
        writeFile.write("                    index = i + 1\n")
        writeFile.write("                    break\n")
        writeFile.write("                i += 1\n")
        writeFile.write("            tofile.write(\">>\", output, args[index])\n")
        writeFile.write("        elif(\">\" in args):\n")
        writeFile.write("            if(flag == 0):\n")
        writeFile.write("                i = 0\n")
        writeFile.write("                index = 0\n")
        writeFile.write("                for j in args:\n")
        writeFile.write("                    if(i == 0):\n")
        writeFile.write("                        i += 1\n")
        writeFile.write("                        continue\n")
        writeFile.write("                    if(args[i] == \">\"):\n")
        writeFile.write("                        index = i + 1\n")
        writeFile.write("                        break\n")
        writeFile.write("                    i += 1\n")
        writeFile.write("                tofile.write(\">\", output, args[index])\n")
        writeFile.write("        # If not told to send output to a file, print to screen.\n")
        writeFile.write("        else:\n")
        writeFile.write("            print(output)\n")
        writeFile.close()
        writeFile = open("cd.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# cd is a basic script that deciphers tildas and slashes then goes into desired directory\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os\n")
        writeFile.write("import systemvariables\n\n")
        writeFile.write("# Variable\n")
        writeFile.write("currentdir = \"\"\n\n")
        writeFile.write("# Main Function\n")
        writeFile.write("def go(args):\n")
        writeFile.write("    path = args[0]\n")
        writeFile.write("    currentdir = os.getcwd()\n")
        writeFile.write("    otherdir = systemvariables.lastdir\n\n")
        writeFile.write("    # If we have inputed something special, go to a special place.\n")
        writeFile.write("    # If not, go to where directed.\n")
        writeFile.write("    if(path == \"~\"):\n")
        writeFile.write("        os.chdir(systemvariables.HOME)\n")
        writeFile.write("    elif(path == \"-\"):\n")
        writeFile.write("        os.chdir(systemvariables.lastdir)\n")
        writeFile.write("    elif(path == \"/\"):\n")
        writeFile.write("        os.chdir(systemvariables.ROOT)\n")
        writeFile.write("    elif(path == \"$settingspath\"):\n")
        writeFile.write("        os.chdir(systemvariables.settingspath)\n")
        writeFile.write("    elif(path == \"$exepath\"):\n")
        writeFile.write("        os.chdir(systemvariables.exepath)\n")
        writeFile.write("    elif(path == \"/Bash\"):\n")
        writeFile.write("        os.chdir(systemvariables.bshpath)\n")
        writeFile.write("    elif(path == \"/Bash/Bash\"):\n")
        writeFile.write("        os.chdir(systemvariables.settingspath)\n")
        writeFile.write("    elif(path == \"/Bash/Users\"):\n")
        writeFile.write("        os.chdir(systemvariables.usrpath)\n")
        writeFile.write("    elif(path == \"/Bash/Bash/Settings\"):\n")
        writeFile.write("        os.chdir(systemvariables.loginfopath)\n")
        writeFile.write("    elif(path == \"/Bash/Bash/Source\"):\n")
        writeFile.write("        os.chdir(systemvariables.srcpath)\n")
        writeFile.write("    elif(path == \"/Bash/Bash/Source/Include\"):\n")
        writeFile.write("        os.chdir(systemvariables.exepath)\n")
        writeFile.write("    elif(path == \"$bshpath\"):\n")
        writeFile.write("        os.chdir(systemvariables.bshpath)\n")
        writeFile.write("    elif(path == \"$usrpath\"):\n")
        writeFile.write("        os.chdir(systemvariables.usrpath)\n")
        writeFile.write("    elif(path == \"$loginfopath\"):\n")
        writeFile.write("        os.chdir(systemvariables.loginfopath)\n")
        writeFile.write("    elif(path == \"$srcpath\"):\n")
        writeFile.write("        os.chdir(systemvariables.srcpath)\n")
        writeFile.write("    elif(path == \"$USRDOCS\"):\n")
        writeFile.write("        if(systemvariables.USRDOCS == \"null\"):\n")
        writeFile.write("            print(\"bash: cd: null: No such file or directory\")\n")
        writeFile.write("        else:\n")
        writeFile.write("            os.chdir(systemvariables.USRDOCS)\n")
        writeFile.write("    else:\n")
        writeFile.write("        if(path == \"\"):\n")
        writeFile.write("            go(\"~\")\n")
        writeFile.write("        else:\n")
        writeFile.write("            if(os.path.exists(path) == True):\n")
        writeFile.write("                os.chdir(path)\n")
        writeFile.write("            else:\n")
        writeFile.write("                print(\"bash: cd:\", path + \": No such file or directory\")\n")
        writeFile.write("    # Set the lastdir system variable\n")
        writeFile.write("    systemvariables.lastdir = currentdir\n\n")
        writeFile.write("    if(os.getcwd() == systemvariables.lastdir):\n")
        writeFile.write("        systemvariables.lastdir = otherdir")
        writeFile.close()
        writeFile = open("echo.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# echo is a basic script the either echos text given or outputs a variable\n\n")
        writeFile.write("# Import the system variables (to output if asked to)\n")
        writeFile.write("import systemvariables, tofile\n\n")
        writeFile.write("# Main Function. Commented lines are for debugging purposes only. First set a couple of variables\n")
        writeFile.write("def reg(args):\n")
        writeFile.write("    string = args[0]\n")
        writeFile.write("    stringprt = string\n")
        writeFile.write("    ifvar = False\n")
        writeFile.write("    i = 0\n")
        writeFile.write("    endstring = \"\"\n\n")
        writeFile.write("    # See if the first character of a string is a dollar sign, the symbol that declares the want of a\n")
        writeFile.write("    # system variable\n")
        writeFile.write("    if(stringprt.find(\"$\", 0, 1) == 0):\n")
        writeFile.write("        ifvar = True\n")
        writeFile.write("    else:\n")
        writeFile.write("        ifvar = False\n\n")
        writeFile.write("    # If there is a dollar sign, find out what variable we want and print it out. If not, print out\n")
        writeFile.write("    # inputted text\n\n")
        writeFile.write("    for j in args:\n")
        writeFile.write("        if((args[i] == \">\") or (args[i] == \">>\")):\n")
        writeFile.write("            break\n")
        writeFile.write("        if(ifvar == True):\n")
        writeFile.write("            newstr = stringprt[1:]\n")
        writeFile.write("            if((((((newstr == \"usrsession\") or (newstr == \"HOME\")) or (newstr == \"exepath\")) or (newstr == \"USRDOCS\")) or (newstr == \"ROOT\")) or (newstr == \"settingspath\") or (newstr == \"srcpath\") or (newstr == \"loginfopath\") or (newstr == \"usrpath\") or (newstr == \"bshpath\") or (newstr == \"lastdir\")):\n")
        writeFile.write("                if(newstr == \"usrsession\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + " " + systemvariables.usrsession\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.usrsession\n")
        writeFile.write("                elif(newstr == \"HOME\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + " " + systemvariables.HOME\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.HOME\n")
        writeFile.write("                elif(newstr == \"exepath\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + \" \" + systemvariables.exepath\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.exepath\n")
        writeFile.write("                elif(newstr == \"USRDOCS\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + \" \" + systemvariables.USRDOCS\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.USRDOCS\n")
        writeFile.write("                elif(newstr == \"settingspath\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + " " + systemvariables.settingspath\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.settingspath\n")
        writeFile.write("                elif(newstr == \"loginfopath\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + \" \" + systemvariables.loginfopath\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.loginfopath\n")
        writeFile.write("                elif(newstr == \"srcpath\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + \" \" + systemvariables.srcpath\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.srcpath\n")
        writeFile.write("                elif(newstr == \"usrpath\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + \" \" + systemvariables.usrpath\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.usrpath\n")
        writeFile.write("                elif(newstr == \"bshpath\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + \" \" + systemvariables.bshpath\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.bshpath\n")
        writeFile.write("                elif(newstr == \"lastdir\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + \" \" + systemvariables.lastdir\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.lastdir\n")
        writeFile.write("                else:\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + \" \" + systemvariables.ROOT\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.ROOT\n")
        writeFile.write("            else:\n")
        writeFile.write("                if(endstring != \"\"):\n")
        writeFile.write("                    endstring = endstring + \" \" + args[i]\n")
        writeFile.write("                else:\n")
        writeFile.write("                    endstring = args[i]\n")
        writeFile.write("        else:\n")
        writeFile.write("            if(endstring != \"\"):\n")
        writeFile.write("                endstring = endstring + \" \" + args[i]\n")
        writeFile.write("            else:\n")
        writeFile.write("                endstring = args[i]\n")
        writeFile.write("        i += 1\n")
        writeFile.write("    flag = 0\n")
        writeFile.write("    if(\">>\" in args):\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        index = 0\n")
        writeFile.write("        flag = 1\n")
        writeFile.write("        for k in args:\n")
        writeFile.write("            if(i == 0):\n")
        writeFile.write("                i += 1\n")
        writeFile.write("                continue\n")
        writeFile.write("            if(args[i] == \">>\"):\n")
        writeFile.write("                index = i + 1\n")
        writeFile.write("                break\n")
        writeFile.write("            i += 1\n")
        writeFile.write("        tofile.write(\">>\", endstring, args[index])\n")
        writeFile.write("    elif(\">\" in args):\n")
        writeFile.write("        if(flag == 0):\n")
        writeFile.write("            i = 0\n")
        writeFile.write("            index = 0\n")
        writeFile.write("            for k in args:\n")
        writeFile.write("                if(i == 0):\n")
        writeFile.write("                    i += 1\n")
        writeFile.write("                    continue\n")
        writeFile.write("                if(args[i] == \">\"):\n")
        writeFile.write("                    index = i + 1\n")
        writeFile.write("                    break\n")
        writeFile.write("                i += 1\n")
        writeFile.write("            tofile.write(\">\", endstring, args[index])\n")
        writeFile.write("    else:\n")
        writeFile.write("        # If not told to send endstring to a file, print to screen.\n")
        writeFile.write("        print(endstring)")
        writeFile.close()
        writeFile = open("filechk.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# Code is used often, so I created a library for it. If the requested file exists, return True. If not, return False\n\n")
        writeFile.write("# Uses the ls library to get list of all the files in the directory to look through\n")
        writeFile.write("import ls\n\n")
        writeFile.write("# Main function\n")
        writeFile.write("def check(filename):\n")
        writeFile.write("    directory = ls.list()\n")
        writeFile.write("    if(any(filename in s for s in directory)):\n")
        writeFile.write("        return True\n")
        writeFile.write("    else:\n")
        writeFile.write("        return False")
        writeFile.close()
        writeFile = open("ls.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# ls is a basic script that either outputs the files in a directory or returns a list of files in the current\n")
        writeFile.write("# directory\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("from os import walk\n")
        writeFile.write("import os, glob, systemvariables, tofile\n\n")
        writeFile.write("# Function that prints out all files 1 by 1 virtically without any other characters on the screen\n")
        writeFile.write("def show(args):\n")
        writeFile.write("    # Store all output in a variable\n")
        writeFile.write("    output = \"\"\n\n")
        writeFile.write("    # If we don't request to list the current directory and don't want to send output of current\n")
        writeFile.write("    # directory to file, do the following:\n")
        writeFile.write("    if((args[0] != \"\") and ((args[0] != \">\") and (args[0] != \">>\"))):\n")
        writeFile.write("        # Make sure the directory requested exists and that it is a directory\n")
        writeFile.write("        if((os.path.exists(args[0]) == True) and (os.path.isdir(args[0]) == True)):\n")
        writeFile.write("            # Remember what directory we are currently in then change to the requested directory.\n")
        writeFile.write("            lastDir = os.getcwd()\n")
        writeFile.write("            os.chdir(args[0])\n\n")
        writeFile.write("            # Get a listing fo what is in the directory, then list them in a fancy way\n")
        writeFile.write("            dir_list = os.listdir(os.getcwd())\n")
        writeFile.write("            hold = []\n")
        writeFile.write("            i = 0\n")
        writeFile.write("            j = 0\n")
        writeFile.write("            for dirs in dir_list:\n")
        writeFile.write("                if(os.path.isdir(dir_list[i]) == True):\n")
        writeFile.write("                    if(i == len(dir_list) - 1):\n")
        writeFile.write("                        output = output + dir_list[i] + \" [DIR]\"\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        output = output + dir_list[i] + \" [DIR]\\n\"\n")
        writeFile.write("                else:\n")
        writeFile.write("                    hold.append(dir_list[i])\n")
        writeFile.write("                i += 1\n")
        writeFile.write("            for k in hold:\n")
        writeFile.write("                if(j == len(hold) - 1):\n")
        writeFile.write("                    output = output + hold[j]\n")
        writeFile.write("                else:\n")
        writeFile.write("                    output = output + hold[j] + \"\\n\"\n")
        writeFile.write("                j += 1\n\n")
        writeFile.write("            # Go to the directory we were just in.\n")
        writeFile.write("            os.chdir(lastDir)\n\n")
        writeFile.write("            # If asked to do so, send output to a file. Either overwrite a file or append to it.\n")
        writeFile.write("            if(\">>\" in args):\n")
        writeFile.write("                i = 0\n")
        writeFile.write("                index = 0\n")
        writeFile.write("                for j in args:\n")
        writeFile.write("                    if(i == 0):\n")
        writeFile.write("                        i += 1\n")
        writeFile.write("                        continue\n")
        writeFile.write("                    if(args[i] == \">>\"):\n")
        writeFile.write("                        index = i + 1\n")
        writeFile.write("                        break\n")
        writeFile.write("                    i += 1\n")
        writeFile.write("                tofile.write(\">>\", output, args[index])\n")
        writeFile.write("            elif(\">\" in args):\n")
        writeFile.write("                i = 0\n")
        writeFile.write("                index = 0\n")
        writeFile.write("                for j in args:\n")
        writeFile.write("                    if(i == 0):\n")
        writeFile.write("                        i += 1\n")
        writeFile.write("                        continue\n")
        writeFile.write("                    if(args[i] == \">\"):\n")
        writeFile.write("                        index = i + 1\n")
        writeFile.write("                        break\n")
        writeFile.write("                    i += 1\n")
        writeFile.write("                tofile.write(\">\", output, args[index])\n")
        writeFile.write("            # If we don't want to send output of command to a file, print the output to the screen.\n")
        writeFile.write("            else:\n")
        writeFile.write("                print(output)\n")
        writeFile.write("        else:\n")
        writeFile.write("            # Error Message: if it is a file repeat file name\n")
        writeFile.write("            if(os.path.isfile(args[0]) == True):\n")
        writeFile.write("                print(args[0])\n")
        writeFile.write("            else:\n")
        writeFile.write("                print(\"ls: cannot access '\" + args[0] + \"': No such file or directory\")\n\n")
        writeFile.write("    # Either print listing of current directory or send output of command to file.\n")
        writeFile.write("    # Pretty much the same as before.\n")
        writeFile.write("    elif((args[0] == \"\") or (args[0] == \">\") or args[0] == \">>\"):\n")
        writeFile.write("        dir_list = os.listdir(os.getcwd())\n")
        writeFile.write("        hold = []\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        j = 0\n")
        writeFile.write("        for dirs in dir_list:\n")
        writeFile.write("            #print(os.path.isdir(str(dir_list[i])))\n")
        writeFile.write("            if(os.path.isdir(dir_list[i]) == True):\n")
        writeFile.write("                if(os.path.isdir(dir_list[i]) == True):\n")
        writeFile.write("                    if(i == len(dir_list) - 1):\n")
        writeFile.write("                        if(len(hold) == 0):\n")
        writeFile.write("                            output = output + dir_list[i] + \" [DIR]\"\n")
        writeFile.write("                        else:\n")
        writeFile.write("                            output = output + dir_list[i] + \" [DIR]\\n\"\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        output = output + dir_list[i] + \" [DIR]\\n\"\n")
        writeFile.write("            else:\n")
        writeFile.write("                hold.append(dir_list[i])\n")
        writeFile.write("            i += 1\n")
        writeFile.write("        for k in hold:\n")
        writeFile.write("            if(j == len(hold) - 1):\n")
        writeFile.write("                output = output + hold[j]\n")
        writeFile.write("            else:\n")
        writeFile.write("                output = output + hold[j] + \"\\n\"\n")
        writeFile.write("            j += 1\n\n")
        writeFile.write("        if(\">>\" in args):\n")
        writeFile.write("            tofile.write(\">>\", output, args[1])\n")
        writeFile.write("        elif(\">\" in args):\n")
        writeFile.write("            tofile.write(\">\", output, args[1])\n")
        writeFile.write("        else:\n")
        writeFile.write("            print(output)\n")
        writeFile.write("# Function that returns a list of everything in the current directory\n")
        writeFile.write("def list():\n")
        writeFile.write("    theList = os.listdir(os.getcwd())\n")
        writeFile.write("    return theList\n\n")
        writeFile.write("# Function that prints out all of the variables, unlike the echo script that only prints out 1 requested\n")
        writeFile.write("# variable\n")
        writeFile.write("def vars(args):\n")
        writeFile.write("    output = \"\"\n")
        writeFile.write("    output = output + \"usrsession: \" + systemvariables.usrsession + \"\\n\"\n")
        writeFile.write("    output = output + \"HOME: \" + systemvariables.HOME + \"\\n\"\n")
        writeFile.write("    output = output + \"ROOT: \" + systemvariables.ROOT + \"\\n\"\n")
        writeFile.write("    output = output + \"exepath: \" + systemvariables.exepath + \"\\n\"\n")
        writeFile.write("    output = output + \"USRDOCS: \" + systemvariables.USRDOCS + \"\\n\"\n")
        writeFile.write("    output = output + \"settingspath: \" + systemvariables.settingspath + \"\\n\"\n")
        writeFile.write("    output = output + \"loginfopath: \" + systemvariables.loginfopath + \"\\n\"\n")
        writeFile.write("    output = output + \"srcpath: \" + systemvariables.srcpath + \"\\n\"\n")
        writeFile.write("    output = output + \"bshpath: \" + systemvariables.bshpath + \"\\n\"\n")
        writeFile.write("    output = output + \"lastdir: \" + systemvariables.lastdir + \"\\n\"\n")
        writeFile.write("    output = output + \"directorystack: \" + str(systemvariables.directorystack)\n")
        writeFile.write("    flag = 0\n")
        writeFile.write("    if(\">>\" in args):\n")
        writeFile.write("        flag = 1\n")
        writeFile.write("        tofile.write(\">>\", output, args[1])\n")
        writeFile.write("    elif(\">\" in args):\n")
        writeFile.write("        if(flag == 0):\n")
        writeFile.write("            tofile.write(\">\", output, args[1])\n")
        writeFile.write("    else:\n")
        writeFile.write("        print(output)")
        writeFile.close()
        
        writeFile = open("mkdir.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n\n")
        writeFile.write("# mkdir simply makes directories, but is written as a seperate script to take advantage of multiple arguments\n\n")
        writeFile.write("# Library\n")
        writeFile.write("import os\n\n")
        writeFile.write("# Main Function\n")
        writeFile.write("def create(args):\n")
        writeFile.write("    # If we recieved -p in an argument, do the following:\n")
        writeFile.write("    if(\"-p\" in args):\n")
        writeFile.write("        # Figure out where the -p argument is so that we can find what path it is talking about\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        index = 0\n")
        writeFile.write("        for j in args:\n")
        writeFile.write("            if(args[i] == \"-p\"):\n")
        writeFile.write("                index = i\n")
        writeFile.write("                break\n")
        writeFile.write("            i += 1\n")
        writeFile.write("        if(index == 0):\n")
        writeFile.write("            index += 1\n")
        writeFile.write("        else:\n")
        writeFile.write("            index -= 1\n")
        writeFile.write("        path = args[index]\n\n")
        writeFile.write("        # Reset and create some counters\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        j = \"\"\n")
        writeFile.write("        k = 0\n\n")
        writeFile.write("        # Array of directories\n")
        writeFile.write("        directories = [\"\"]\n\n")
        writeFile.write("        # Add all the directories we need to go into or create to that array\n")
        writeFile.write("        for j in path:\n")
        writeFile.write("            if(path[i] == \"/\"):\n")
        writeFile.write("                directories.append(\"\")\n")
        writeFile.write("                k += 1\n")
        writeFile.write("                i += 1\n")
        writeFile.write("                continue\n")
        writeFile.write("            directories[k] = directories[k] + j\n")
        writeFile.write("            i += 1\n\n")
        writeFile.write("        # Reset our counters, we'll need them again.\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        j = 0\n\n")
        writeFile.write("        # Remember what directory we are in right now\n")
        writeFile.write("        lastDir = os.getcwd()\n\n")
        writeFile.write("        # Go and create the directories stored in that array\n")
        writeFile.write("        for j in directories:\n")
        writeFile.write("            if(os.path.exists(j) == True):\n")
        writeFile.write("                os.chdir(j)\n")
        writeFile.write("            else:\n")
        writeFile.write("                os.mkdir(j)\n")
        writeFile.write("                os.chdir(j)\n\n")
        writeFile.write("        # Go back to our initial directory\n")
        writeFile.write("        os.chdir(lastDir)\n")
        writeFile.write("    else:\n\n")
        writeFile.write("        # Simply make the directories provided\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        for j in args:\n")
        writeFile.write("            os.mkdir(args[i])\n")
        writeFile.write("            i += 1")
        writeFile.close()

        writeFile = open("mv.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n\n")
        writeFile.write("# mv is a file to move files or rename files, as a new file to help with multiple arguments\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os\n")
        writeFile.write("import filechk\n\n")
        writeFile.write("# Main Function\n")
        writeFile.write("def move(file, dstfile):\n")
        writeFile.write("    # Create some counters\n")
        writeFile.write("    holder = \"\"\n")
        writeFile.write("    i = 0\n")
        writeFile.write("    j = 0\n\n")
        writeFile.write("    # If we have a /, we need to move the file into a directory\n")
        writeFile.write("    if(dstfile.find(\"/\") != -1):\n\n")
        writeFile.write("        # Figure out what directories we need to go through for the destination\n")
        writeFile.write("        for i in dstfile:\n")
        writeFile.write("            if(dstfile[j] == \"/\"):\n")
        writeFile.write("                break\n")
        writeFile.write("            holder = holder + dstfile[j]\n")
        writeFile.write("            j += 1\n\n")
        writeFile.write("    # Make sure the path exists\n")
        writeFile.write("    if(filechk.check(file) == True):\n\n")
        writeFile.write("        # If we are told to move it into a directory, make sure it is a directory\n")
        writeFile.write("        if(os.path.isdir(holder) == True):\n")
        writeFile.write("            os.rename(file, dstfile)\n")
        writeFile.write("        else:\n")
        writeFile.write("            # Error message, or rename the file\n")
        writeFile.write("            if(holder != \"\"):\n")
        writeFile.write("                print(\"mv: cannot move '\" + file + \"' to '\" + dstfile + \"': No such file or directory\")\n")
        writeFile.write("            else:\n")
        writeFile.write("                os.rename(file, dstfile)\n")
        writeFile.write("    else:\n")
        writeFile.write("        # Error message\n")
        writeFile.write("        print(\"mv: cannot stat '\" + file + \": No such file or directory\")")
        writeFile.close()

        writeFile = open("nano.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# nano is a basic script that opens a file in notepad. The nano script does NOT try to imitate the real GNU Nano\n")
        writeFile.write("# text editor.\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os\n")
        writeFile.write("import touch\n")
        writeFile.write("import ls\n\n")
        writeFile.write("# Main Function. First get a listing of the directory using the ls script\n")
        writeFile.write("def write(args):\n")
        writeFile.write("    theList = ls.list()\n")
        writeFile.write("    i = 0\n")
        writeFile.write("    # Find out if there is a file called the same as the input text. If not, create the file using the touch\n")
        writeFile.write("    # script before opening notepad\n")
        writeFile.write("    for j in args:\n")
        writeFile.write("        filename = args[i]\n")
        writeFile.write("        if(any(filename in s for s in theList)):\n")
        writeFile.write("            os.system(\"notepad \" + filename)\n")
        writeFile.write("        else:\n")
        writeFile.write("            giveArgs = [filename]\n")
        writeFile.write("            touch.write(giveArgs)\n")
        writeFile.write("            os.system(\"notepad \" + filename)\n")
        writeFile.write("        i += 1")
        writeFile.close()

        writeFile = open("oschk.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n\n")
        writeFile.write("# This script's job is to double check to make sure that we are indeed running Windows.\n\n")
        writeFile.write("# Import our library\n")
        writeFile.write("import platform, os\n\n")
        writeFile.write("# Main Function\n")
        writeFile.write("def check():\n")
        writeFile.write("    if(platform.system() != \"Windows\"):\n")
        writeFile.write("        print(\"Bash for Windows has seen that you are not using Windows. Launching Bash...\")\n")
        writeFile.write("        os.system(\"bash\")\n")
        writeFile.write("        exit()")
        writeFile.close()

        writeFile = open("popd.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# Popd is the companion command to Pushd, which is a program that allows you\n")
        writeFile.write("# to add directories to a \"stack\", then using it's companion, Popd, allows \n")
        writeFile.write("# you to go to the last directory in that \"stack\". Really useful!\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os, systemvariables, pushd\n\n")
        writeFile.write("# Main Function\n")
        writeFile.write("def go():\n")
        writeFile.write("    # Only do the following if there is something in the directory stack!!!\n")
        writeFile.write("    if(systemvariables.directorystack[0] != \"\"):\n\n")
        writeFile.write("        # Go to the first path listed in the directory stack\n")
        writeFile.write("        os.chdir(systemvariables.directorystack[0])\n\n")
        writeFile.write("        # Remove 1 item from the stack using the pushd program's remove function\n")
        writeFile.write("        pushd.remove(1)\n\n")
        writeFile.write("        # Do the whole generate display thing like we did in the Pushd program\n")
        writeFile.write("        stackDisplay = \"\"\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        while(i <= 7):\n")
        writeFile.write("            stackDisplay = systemvariables.directorystack[i] + \" \" + stackDisplay\n")
        writeFile.write("            i += 1\n")
        writeFile.write("        print(stackDisplay, os.getcwd())\n")
        writeFile.write("    else:\n")
        writeFile.write("        # Directory Stack Empty Error\n")
        writeFile.write("        print(\"bash: popd: directory stack empty\")")
        writeFile.close()

        writeFile = open("pushd.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# Pushd is a program that allows you to add directories to a \"stack\", then\n")
        writeFile.write("# using it's companion, Popd, allows you to go to the last directory in\n")
        writeFile.write("# that \"stack\". Really useful!\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os, systemvariables, cd\n\n")
        writeFile.write("# Function to add a directory to the stack\n")
        writeFile.write("def add(path):\n\n")
        writeFile.write("    # Get ready for a loop\n")
        writeFile.write("    i = 7\n")
        writeFile.write("    while(i > 0):\n\n")
        writeFile.write("        # Take the entry left to the one we are looking at and move\n")
        writeFile.write("        # it to the one we are looking at now\n")
        writeFile.write("        systemvariables.directorystack[i] = systemvariables.directorystack[i-1]\n\n")
        writeFile.write("        # Go to look at the next entry\n")
        writeFile.write("        i -= 1\n\n")
        writeFile.write("    # Now fill in the first entry with the path we inputed\n")
        writeFile.write("    systemvariables.directorystack[0] = path\n\n")
        writeFile.write("# Function to remove an entry from the stack\n")
        writeFile.write("def remove(times):\n\n")
        writeFile.write("    # Commented lines of code are for debugging purposes only.\n")
        writeFile.write("    #print(systemvariables.directorystack)\n\n")
        writeFile.write("    # Counter\n")
        writeFile.write("    j = 0\n\n")
        writeFile.write("    # Loop to do this as many times as requested\n")
        writeFile.write("    while(j != times):\n")
        writeFile.write("        # Another Counter\n")
        writeFile.write("        i = 0\n\n")
        writeFile.write("        # Do this for all items in the stack\n")
        writeFile.write("        while(i < 7):\n")
        writeFile.write("            #print(systemvariables.directorystack)\n\n")
        writeFile.write("            # Move the item we are looking at to the right\n")
        writeFile.write("            systemvariables.directorystack[i] = systemvariables.directorystack[i+1]\n\n")
        writeFile.write("            # Increment\n")
        writeFile.write("            i += 1\n\n")
        writeFile.write("        # Delete the last item\n")
        writeFile.write("        systemvariables.directorystack[7] = \"\"\n\n")
        writeFile.write("        # Increment the counter to prepare to do it again!\n")
        writeFile.write("        j += 1\n\n")
        writeFile.write("# Main Function\n")
        writeFile.write("def go(args):\n")
        writeFile.write("    path = args[0]\n")
        writeFile.write("    # Check to make sure the path exists.\n")
        writeFile.write("    if(os.path.exists(path) == True):\n")
        writeFile.write("        # Add the current directory to the stack using the function we made earlier\n")
        writeFile.write("        add(os.getcwd())\n\n")
        writeFile.write("        # Create a variable to represent the stack for output\n")
        writeFile.write("        stackDisplay = \"\"\n\n")
        writeFile.write("        # Create a counter for the loop that we will program momentarily\n")
        writeFile.write("        i = 0\n\n")
        writeFile.write("        # Do this starting at the beginning of the stack going to the end for\n")
        writeFile.write("        # all the items in the stack\n")
        writeFile.write("        while(i <= 7):\n")
        writeFile.write("            # Add the item we are looking at to the Display variable, insert\n")
        writeFile.write("            # a space, then add on what we already have in the variable\n")
        writeFile.write("            stackDisplay = systemvariables.directorystack[i] + \" \" + stackDisplay\n\n")
        writeFile.write("            # Decrement to shift focus to the item to the right of the stack\n")
        writeFile.write("            i += 1\n\n")
        writeFile.write("        # Finally, display the display we made plus the current directory we\n")
        writeFile.write("        # are in, but only after going to that directory that is first in\n")
        writeFile.write("        # the stack\n")
        writeFile.write("        os.chdir(path)\n")
        writeFile.write("        print(stackDisplay, os.getcwd())\n")
        writeFile.write("    else:\n")
        writeFile.write("        # Directory Not Found Error\n")
        writeFile.write("        print(\"bash: pushd:\", path + \": No such file or directory\")")
        writeFile.close()
        
        writeFile = open("repair.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# Repair is a script that tries to solve any problems that comes up\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os\n")
        writeFile.write("import username\n")
        writeFile.write("import systemvariables, mkdir\n\n")
        writeFile.write("# Repair for anything missing in the base folder\n")
        writeFile.write("# Repair for anything missing in the base of the user folder\n")
        writeFile.write("def baseusrrepair():\n")
        writeFile.write("    # We need to be in this directory, stored as a System Variable we\n")
        writeFile.write("    # set at Startup\n")
        writeFile.write("    os.chdir(systemvariables.settingspath)\n\n")
        writeFile.write("    # If needed, create a new user account\n")
        writeFile.write("    if((os.path.exists(\"Settings/ivhzadgz.bws\") == False) or (os.path.exists(\"Settings/kvnnadgz.bws\") == False)):\n")
        writeFile.write("        username.get()\n\n")
        writeFile.write("    print(\"Solving Problems...\")\n\n")
        writeFile.write("    # Get the username information\n")
        writeFile.write("    username = open(\"Settings/ivhzadgz.bws\")\n\n")
        writeFile.write("    # Put the contents of the username in a variable so we can use\n")
        writeFile.write("    # it any time without having to be in that directory\n")
        writeFile.write("    usrname = username.read()\n\n")
        writeFile.write("    # We don't need the origonal variable anymore\n")
        writeFile.write("    username.close()\n\n")
        writeFile.write("    # Start Recreating Folders\n")
        writeFile.write("    os.chdir(\"..\")\n")
        writeFile.write("    os.mkdir(\"Users\")\n")
        writeFile.write("    os.chdir(\"Users\")\n")
        writeFile.write("    os.mkdir(usrname + \"/\")\n")
        writeFile.write("    os.chdir(usrname)\n")
        writeFile.write("    os.mkdir(\"Documents\")\n")
        writeFile.write("    os.mkdir(\"Downloads\")\n\n")
        writeFile.write("    # Success message and go to the correct directory\n")
        writeFile.write("    print(\"Repair has solved the problem\")\n")
        writeFile.write("    os.chdir(systemvariables.exepath)\n\n")
        writeFile.write("# Like the function we just had, but only repairs in the user's personal folder\n")
        writeFile.write("def baseusrfilerepair():\n")
        writeFile.write("    # We need to be in this directory, stored as a System Variable we\n")
        writeFile.write("    # set at Startup\n")
        writeFile.write("    os.chdir(systemvariables.settingspath)\n\n")
        writeFile.write("    # If needed, create a new user account\n")
        writeFile.write("    if((os.path.exists(\"Settings/ivhzadgz.bws\") == False) or (os.path.exists(\"Settings/kvnnadgz.bws\") == False)):\n")
        writeFile.write("        username.get()\n\n")
        writeFile.write("    print(\"Solving Problems...\")\n\n")
        writeFile.write("    # Get the username information\n")
        writeFile.write("    username = open(\"Settings/ivhzadgz.bws\")\n\n")
        writeFile.write("    # Put the contents of the username in a variable so we can use\n")
        writeFile.write("    # it any time without having to be in that directory\n")
        writeFile.write("    usrname = username.read()\n\n")
        writeFile.write("    # We don't need the origonal variable anymore\n")
        writeFile.write("    username.close()\n\n")
        writeFile.write("    # Start Recreating Folders\n")
        writeFile.write("    os.chdir(\"../Users\")\n")
        writeFile.write("    os.mkdir(usrname + \"/\")\n")
        writeFile.write("    os.chdir(usrname)\n")
        writeFile.write("    os.mkdir(\"Documents\")\n")
        writeFile.write("    os.mkdir(\"Downloads\")\n\n")
        writeFile.write("    # Success message and go to the correct directory\n")
        writeFile.write("    print(\"Repair has solved the problem\")\n")
        writeFile.write("    os.chdir(systemvariables.exepath)\n\n")
        writeFile.write("# Repair for anything missing in the settings folder\n")
        writeFile.write("def settingsrepair():\n")
        writeFile.write("    print(\"Solving Problems...\")\n")
        writeFile.write("    os.chdir(systemvariables.exepath + \"/../..\")\n")
        writeFile.write("    os.mkdir(\"Settings\")\n")
        writeFile.write("    username.get(os.getcwd())\n")
        writeFile.write("    os.chdir(systemvariables.exepath + \"/../..\")\n\n")
        writeFile.write("# Repair the Documents Folder\n")
        writeFile.write("def docs():\n")
        writeFile.write("    print(\"Solving Problems\")\n")
        writeFile.write("    os.chdir(systemvariables.HOME)\n")
        writeFile.write("    mkdir.create([\"Documents\"])\n")
        writeFile.write("    if(os.path.exists(\"Documents\") == True):\n")
        writeFile.write("        print(\"Success! Note: Anything that was in the Documents folder before was deleted.\")\n")
        writeFile.write("        return True\n")
        writeFile.write("    else:\n")
        writeFile.write("        systemvariables.USRDOCS = \"null\"\n")
        writeFile.write("        print(\"Failed. USRDOCS Variable set as null.\")\n")
        writeFile.write("        return False\n")
        writeFile.close()

        writeFile = open("cp.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# cp is a basic script that copies a file\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import filechk\n")
        writeFile.write("import os\n\n")
        writeFile.write("# Main Function. First checks if the file wanted exists\n")
        writeFile.write("def copy(srcfile, dstfile):\n")
        writeFile.write("    if(filechk.check(srcfile) == True):\n")
        writeFile.write("        # Read the file, copy the contents to a new file, then changes the name and/or moves it to new directory\n")
        writeFile.write("        source = open(srcfile, \"r\")\n")
        writeFile.write("        copy = open(srcfile + \" - copy\", \"w\")\n")
        writeFile.write("        copy.write(source.read())\n")
        writeFile.write("        copy.close()\n")
        writeFile.write("        source.close()\n")
        writeFile.write("        copiedfile = srcfile + \" - copy\"\n")
        writeFile.write("        os.rename(copiedfile, dstfile)\n")
        writeFile.write("    else:\n")
        writeFile.write("        print(\"cp: The file\", srcfile, \"does not exist so not copying!\")")
        writeFile.close()

        writeFile = open("pwd.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# pwd is a basic 3-lined script that simply returns the path of the directory we are currently in\n\n")
        writeFile.write("# Our only library\n")
        writeFile.write("import os\n\n")
        writeFile.write("# Main Function\n")
        writeFile.write("def get():\n")
        writeFile.write("    return os.getcwd()")
        writeFile.close()

        writeFile = open("rm.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# rm is a basic script that removes a file\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os\n")
        writeFile.write("import shutil\n")
        writeFile.write("import ls\n")
        writeFile.write("import systemvariables\n\n")
        writeFile.write("# Main Function. First get a listing of the directory from the ls script\n")
        writeFile.write("def remove(args):\n")
        writeFile.write("    # Counters and a list of the directory\n")
        writeFile.write("    directory = ls.list()\n")
        writeFile.write("    i = 0\n")
        writeFile.write("    m = 0\n")
        writeFile.write("    n = 0\n\n")
        writeFile.write("    # Recursive function\n")
        writeFile.write("    if(\"-r\" in args):\n")
        writeFile.write("        # Set the last index to the last index in the array\n")
        writeFile.write("        lastIndex = len(args) - 1\n\n")
        writeFile.write("        # If the first thing in the list of arguments is -r, do the following\n")
        writeFile.write("        if(args[0] == \"-r\"):\n\n")
        writeFile.write("            # Remove the first argument\n")
        writeFile.write("            args.pop(0)\n\n")
        writeFile.write("            # Do this for every item in the arguments array\n")
        writeFile.write("            for j in args:\n\n")
        writeFile.write("                # Set this variable to the current item in the args array\n")
        writeFile.write("                file = args[i]\n\n")
        writeFile.write("                # Do this for every file in the directory\n")
        writeFile.write("                if(any(file in s for s in directory)):\n")
        writeFile.write("                    # Make sure it's a directory\n")
        writeFile.write("                    if(os.path.isdir(file) == True):\n")
        writeFile.write("                        # Protection for the Documents folder, which could break the program\n")
        writeFile.write("                        if(os.getcwd() == systemvariables.HOME):\n")
        writeFile.write("                            if(file == \"Documents\"):\n")
        writeFile.write("                                force = input(\"rm: remove write-protected directory '\" + file + \"'? \")\n")
        writeFile.write("                                if((force == \"y\") or (force == \"Y\")):\n")
        writeFile.write("                                    shutil.rmtree(file)\n")
        writeFile.write("                            # If the directory mentioned isn't the documents directory, remove the directory\n")
        writeFile.write("                            # no problem\n")
        writeFile.write("                            else:\n")
        writeFile.write("                                shutil.rmtree(file)\n")
        writeFile.write("                        # If the current directory isn't the home directory, remove the directory no problem\n")
        writeFile.write("                        else:\n")
        writeFile.write("                            shutil.rmtree(file)\n")
        writeFile.write("                    # If it isn't a directory, just delete the file\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        os.remove(file)\n")
        writeFile.write("                # Error Message\n")
        writeFile.write("                else:\n")
        writeFile.write("                    print(\"rm: cannot remove '\" + file + \": No such file or directory\")\n\n")
        writeFile.write("                # Increment our counter\n")
        writeFile.write("                i += 1\n")
        writeFile.write("        # If the last arguemnt is -r, do the following\n")
        writeFile.write("        elif(args[lastIndex] == \"-r\"):\n\n")
        writeFile.write("            # Remove the last argument from the array\n")
        writeFile.write("            args.pop(lastIndex)\n\n")
        writeFile.write("            # For everything in the arguments array:\n")
        writeFile.write("            for j in args:\n")
        writeFile.write("                file = args[i]\n")
        writeFile.write("                if(any(file in s for s in directory)):\n")
        writeFile.write("                    # Make sure it isn't a directory\n")
        writeFile.write("                    if(os.path.isdir(file) == True):\n")
        writeFile.write("                        shutil.rmtree(file)\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        os.remove(file)\n")
        writeFile.write("                else:\n")
        writeFile.write("                    print(\"rm: cannot remove '\" + file + \": No such file or directory\")\n")
        writeFile.write("                i += 1\n")
        writeFile.write("    else:\n")
        writeFile.write("        for j in args:\n")
        writeFile.write("            file = args[i]\n")
        writeFile.write("            # If it exists, remove it. If not, display a message\n")
        writeFile.write("            if(any(file in s for s in directory)):\n")
        writeFile.write("                # Make sure it isn't a directory\n")
        writeFile.write("                if(os.path.isfile(file) == True):\n")
        writeFile.write("                    os.remove(file)\n")
        writeFile.write("                else:\n")
        writeFile.write("                    print(\"rm: cannot remove '\" + file + \": Is a directory\")\n")
        writeFile.write("            else:\n")
        writeFile.write("                print(\"rm: cannot remove '\" + file + \": No such file or directory\")\n")
        writeFile.write("            i += 1")
        writeFile.close()

        writeFile = open("Startup.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# Startup is the file that starts off Bash For Windows. You can only run Bash for Windows with this script.\n\n")
        writeFile.write("# Import libraries\n")
        writeFile.write("import platform\n")
        writeFile.write("import os\n")
        writeFile.write("# If we are not in the right place, get us to the right place\n")
        writeFile.write("if(os.path.exists(os.getcwd() + \"/../Include\") == False):\n")
        writeFile.write("    os.chdir(\"Bash/Bash/Source/Include\")\n")
        writeFile.write("import bash\n")
        writeFile.write("import os.path\n")
        writeFile.write("import username\n")
        writeFile.write("import usrmgr\n")
        writeFile.write("import usrmgr2\n")
        writeFile.write("import repair\n")
        writeFile.write("import systemvariables\n")
        writeFile.write("import time\n\n")
        writeFile.write("# The commented out lines are for me to use for debugging purposes only.\n")
        writeFile.write("#print(os.getcwd())\n")
        writeFile.write("#print(os.path.dirname(os.path.realpath(__file__)))\n\n")
        writeFile.write("# Set a system variable\n")
        writeFile.write("systemvariables.exepath = os.getcwd()\n")
        writeFile.write("systemvariables.settingspath = systemvariables.exepath + \"/../..\"\n\n")
        writeFile.write("# Check to make sure we are running on Windows and if not start bash\n")
        writeFile.write("if(platform.system() != \"Windows\"):\n")
        writeFile.write("    print(\"Bash for Windows has seen that you are not using Windows. Launching Bash...\")\n")
        writeFile.write("    os.system(\"bash\")\n")
        writeFile.write("    exit()\n\n")
        writeFile.write("# Move to the root of the file structure\n")
        writeFile.write("os.chdir(systemvariables.exepath + \"/../..\")\n")
        writeFile.write("#print(os.getcwd())\n\n")
        writeFile.write("os.chdir(\"../..\")\n")
        writeFile.write("#print(os.getcwd())\n\n")
        writeFile.write("usrname = open(\"Bash/Bash/Settings/ivhzadgz.bws\")\n\n")
        writeFile.write("# See if any folders are deleted and if they are attempt to fix it using the repair script\n")
        writeFile.write("if(os.path.exists(\"Bash/Users\") == False):\n")
        writeFile.write("    choice = input(\"Unfortunatly, Bash for Windows could not find your data. Do you want to try to fix this with Bash for Windows Repair? [y, N] # \")\n")
        writeFile.write("    if((choice == \"y\") or (choice == \"Y\")):\n")
        writeFile.write("        repair.baseusrrepair()\n")
        writeFile.write("    else:\n")
        writeFile.write("        print(\"Abort.\")\n\n")
        writeFile.write("# Go back to here so that we don't trigger an unneeded repair\n")
        writeFile.write("os.chdir(systemvariables.settingspath + \"/../..\")\n\n")
        writeFile.write("# Check if the user folder was deleted\n")
        writeFile.write("if(os.path.exists(\"Bash/Users/\" + usrname.read()) == False):\n")
        writeFile.write("    choice = input(\"Unfortunatly, Bash for Windows could not find your data. Do you want to try to fix this with Bash for Windows Repair? [y, N] # \")\n")
        writeFile.write("    if((choice == \"y\") or (choice == \"Y\")):\n")
        writeFile.write("        repair.baseusrfilerepair()\n")
        writeFile.write("    else:\n")
        writeFile.write("        print(\"Abort.\")\n\n")
        writeFile.write("# We don't need this file to stay open\n")
        writeFile.write("usrname.close()\n\n")
        writeFile.write("# Go back to here so that we don't trigger an unneeded repair\n")
        writeFile.write("os.chdir(systemvariables.settingspath + \"/../..\")\n\n")
        writeFile.write("# Tell the login prompt what folder we are in\n")
        writeFile.write("usrmgr2.usrcheck(os.getcwd())\n")
        writeFile.write("username = open(\"Bash/Bash/Settings/ivhzadgz.bws\" , \"r\")\n\n")
        writeFile.write("# Call the login prompt\n")
        writeFile.write("usrmgr.logon()")
        writeFile.close()

        writeFile = open("systemvariables.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# systemvariables holds all variables open to all parts of the system who import them. The variables can be set, modified,\n")
        writeFile.write("# and read depending on what a script may need to do with them. The end user may only see what are in the variables through\n")
        writeFile.write("# means of the lsvars and echo commands.\n\n")
        writeFile.write("usrsession = \"\"\n")
        writeFile.write("HOME = \"\"\n")
        writeFile.write("ROOT = \"\"\n")
        writeFile.write("exepath = \"\"\n")
        writeFile.write("USRDOCS = \"\"\n")
        writeFile.write("settingspath = \"\"\n")
        writeFile.write("loginfopath = \"\"\n")
        writeFile.write("srcpath = \"\"\n")
        writeFile.write("usrpath = \"\"\n")
        writeFile.write("bshpath = \"\"\n")
        writeFile.write("lastdir = \"\"\n")
        writeFile.write("directorystack = [\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]")
        writeFile.close()

        writeFile = open("touch.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# touch is a script that creates a new empty file\n\n")
        writeFile.write("# Our only library\n")
        writeFile.write("import os\n\n")
        writeFile.write("# Main function\n")
        writeFile.write("def write(args):\n")
        writeFile.write("    i = 0\n")
        writeFile.write("    for j in args:\n")
        writeFile.write("        filename = args[i]\n")
        writeFile.write("        new = open(filename, \"w\")\n")
        writeFile.write("        new.write("")\n")
        writeFile.write("        new.close()")
        writeFile.close()

        writeFile = open("username.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# username sets the username and password\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os\n")
        writeFile.write("import systemvariables\n\n")
        writeFile.write("# Main Function\n")
        writeFile.write("def get():\n")
        writeFile.write("    os.chdir(systemvariables.settingspath)\n")
        writeFile.write("    username = input(\"What do you want your user name to be? # \")\n")
        writeFile.write("    namefile = open(\"Settings/ivhzadgz.bws\", \"w\")\n")
        writeFile.write("    namefile.write(username)\n")
        writeFile.write("    namefile.close\n")
        writeFile.write("    password = input(\"What Password?                         # \")\n")
        writeFile.write("    passfile = open(\"Settings/kvnnadgz.bws\", \"w\")\n")
        writeFile.write("    passfile.write(password)\n")
        writeFile.write("    passfile.close")
        writeFile.close()

        writeFile = open("usrmgr.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# usrmgr is a script responsable for the login prompt, the not-yet implemented multiple user function and\n")
        writeFile.write("# welcoming the user into Bash For Windows. Despite not being the first script executed, this is the first\n")
        writeFile.write("# time the user interacts with Bash For Windows.\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os\n")
        writeFile.write("import repair\n")
        writeFile.write("import bash, platform\n")
        writeFile.write("import systemvariables, oschk\n\n")
        writeFile.write("# Clear the screen to get rid of the messages from the imported libraries\n")
        writeFile.write("os.system(\"cls\")\n\n")
        writeFile.write("# Login Prompt\n")
        writeFile.write("def logon():\n")
        writeFile.write("    # Check again to make sure we are running Windows\n")
        writeFile.write("    oschk.check()\n\n")
        writeFile.write("    os.chdir(systemvariables.exepath)\n")
        writeFile.write("    os.chdir(\"../../\")\n")
        writeFile.write("    incorrect = True\n")
        writeFile.write("    while(incorrect == True):\n")
        writeFile.write("        user = open(\"Settings/ivhzadgz.bws\", \"r\")\n")
        writeFile.write("        userguess = input(\"Type a user name # \")\n")
        writeFile.write("        if(userguess == user.read()):\n")
        writeFile.write("           incorrect = False\n")
        writeFile.write("        else:\n")
        writeFile.write("           print(\"Incorrect Username.\")\n")
        writeFile.write("    incorrect = True\n\n")
        writeFile.write("    # Check double check to make sure we are running Windows\n")
        writeFile.write("    if(platform.system() != \"Windows\"):\n")
        writeFile.write("        print(\"Bash for Windows has seen that you are not using Windows. Launching Bash...\")\n")
        writeFile.write("        os.system(\"bash\")\n")
        writeFile.write("        exit()\n\n")
        writeFile.write("    while(incorrect == True):\n")
        writeFile.write("        password = open(\"Settings/kvnnadgz.bws\", \"r\")\n")
        writeFile.write("        passguess = input(\"password # \")\n")
        writeFile.write("        if(passguess == password.read()):\n")
        writeFile.write("            incorrect = False\n")
        writeFile.write("            systemvariables.usrsession = userguess\n")
        writeFile.write("        else:\n")
        writeFile.write("            print(\"Incorrect Password.\")\n")
        writeFile.write("    password.close()\n")
        writeFile.write("    print(\"Welcome to Bash(the Bourne Again Shell) for Windows!\")\n")
        writeFile.write("    user.close()\n")
        writeFile.write("    bash.run()\n\n")
        writeFile.write("# Function for checking a password based on username provided\n")
        writeFile.write("def checkpassword():\n")
        writeFile.write("    session = systemvariables.usrsession\n")
        writeFile.write("    user = \"\"\n")
        writeFile.write("    incorrect = True\n")
        writeFile.write("    if(os.path.exists(\"Settings/ivhzadgzzoneth.bws\") == True):\n")
        writeFile.write("        potentialusr1 = open(\"Settings/ivhzadgzzoneth.bws\" + \"r\")\n")
        writeFile.write("        if(session == potentialusr1.read()):\n")
        writeFile.write("            user = \"Settings/ivhzadgzzoneth.bws\"\n")
        writeFile.write("    potentialusr2 = open(\"Settings/ivhzadgz.bws\", \"r\")\n")
        writeFile.write("    if(session == potentialusr2.read()):\n")
        writeFile.write("        user = \"Settings/ivhzadgzzoneth.bws\"\n")
        writeFile.write("    else:\n")
        writeFile.write("        user = \"No User\"\n")
        writeFile.write("    if(user != \"No User\"):\n")
        writeFile.write("        if(user == \"Settings/ivhzadgzzoneth.bws\"):\n")
        writeFile.write("            while(incorrect == True):\n")
        writeFile.write("                password = open(\"Settings/kvnnadgzzoneth.bws\", \"r\")\n")
        writeFile.write("                passguess = input(\"password # \")\n")
        writeFile.write("                if(passguess == password.read()):\n")
        writeFile.write("                    incorrect = False\n")
        writeFile.write("                else:\n")
        writeFile.write("                   print(\"Incorrect Password.\")\n")
        writeFile.write("        else:\n")
        writeFile.write("            while(incorrect == True):\n")
        writeFile.write("                password = open(\"Settings/kvnnadgz.bws\", \"r\")\n")
        writeFile.write("                passguess = input(\"password # \")\n")
        writeFile.write("                if(passguess == password.read()):\n")
        writeFile.write("                    incorrect = False\n")
        writeFile.write("                else:\n")
        writeFile.write("                    print(\"Incorrect Password.\")\n")
        writeFile.write("    else:\n")
        writeFile.write("        logon()")
        writeFile.close()

        writeFile = open("usrmgr2.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# usrmgr2 checks for a needed repair in the user folders\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os\n")
        writeFile.write("import repair\n")
        writeFile.write("import bash\n")
        writeFile.write("import usrmgr\n\n")
        writeFile.write("# Main function\n")
        writeFile.write("def usrcheck(path):\n")
        writeFile.write("    if(os.path.exists(\"Bash/Bash/Settings\") == False):\n")
        writeFile.write("        choice = input(\"Unfortunatly, Bash for Windows could not find settings. Do you want to try to fix this with Bash for Windows Repair? [y, N] # \")\n")
        writeFile.write("        if((choice == \"y\") or (choice == \"Y\")):\n")
        writeFile.write("            repair.settingsrepair()\n")
        writeFile.write("        else:\n")
        writeFile.write("            print(\"Abort.\")\n")
        writeFile.write("    elif((os.path.exists(\"Bash/Bash/Settings/ivhzadgz.bws\") == False) or (os.path.exists(\"Bash/Bash/Settings/kvnnadgz.bws\") == False)):\n")
        writeFile.write("        choice = input(\"Unfortunatly, Bash for Windows could not find user settings. Do you want to try to fix this with Bash for Windows Repair? [y, N] # \")\n")
        writeFile.write("        if((choice == \"y\") or (choice == \"Y\")):\n")
        writeFile.write("            repair.usersettingsrepair()\n")
        writeFile.write("        else:\n")
        writeFile.write("            print(\"Abort.\")\n")
        writeFile.write("            logon()\n")
        writeFile.write("    else:\n")
        writeFile.write("        usrmgr.logon()")
        writeFile.close()

        writeFile = open("tofile.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n")
        writeFile.write("'''\n")
        writeFile.write("def write(type, contents, filename):\n")
        writeFile.write("    # If told to append, append given text to file.\n")
        writeFile.write("    if(type == \">>\"):\n")
        writeFile.write("        giveTouch = [contents]\n")
        writeFile.write("        file = open(filename, \"a\")\n")
        writeFile.write("        file.write(\"\\n\" + contents)\n")
        writeFile.write("        file.close()\n\n\n")
        writeFile.write("    # If told to overwrite, overwrite a file and put given text in file.\n")
        writeFile.write("    elif(type == \">\"):\n")
        writeFile.write("        giveTouch = [filename]\n")
        writeFile.write("        fileWrite = open(filename, \"w\")\n")
        writeFile.write("        fileWrite.write(contents)\n")
        writeFile.write("        fileWrite.close()")
    print("Creating User Account...")
    os.chdir(path)
    os.chdir("Bash/Bash/Settings")
    nonam = True
    while(nonam == True):
        username = input("What do you want your user name to be? # ")
        namefile = open("ivhzadgz.bws", "w")
        if(" " in username):
            i = 0
            for j in username:
                if(j == " "):
                    username = username[0 : i : ] + username[i + 1: : ]
                    break
                i += 1
            print("The username cannot have a space. Your username has been changed to", username)
        if(username != ""):
            nonam = False
            break
        print("You must have a username. Try again.")
    namefile.write(username)
    namefile.close()
    password = input("What Password?                         # ")
    passfile = open("<PASSWORD>", "w")
    passfile.write(password)
    passfile.close()
    os.chdir("../../Users")
    os.mkdir(username)
    os.chdir(username)
    os.mkdir("Documents")
    os.mkdir("Downloads")
    if(normalInstall == True):
        os.chdir("Documents")
        writeFile = open("Modify_Code_Notes.txt", "w")
        writeFile.write("You have chosen a normal install, which includes all the code for you to modify.\n")
        writeFile.write("If you want to look at and/or modify the code, you may want to know how it works to\n")
        writeFile.write("more easily modify it. If you don't want to modify anything, you can simply delete this\n")
        writeFile.write("file.\n\n\n\n")
        writeFile.write("Here is a visual of how the user goes through the code including all files executed:\n")
        writeFile.write("execute: Startup.py\n")
        writeFile.write("             |\n")
        writeFile.write("             +---- Check if we are running Windows\n")
        writeFile.write("             |                    |\n")
        writeFile.write("             |     Check to see if the file system is intact and if so, repair it\n")
        writeFile.write("             |                    |\n")
        writeFile.write("             |                    +---- repair.py\n")
        writeFile.write("          usrmgr.py\n")
        writeFile.write("             |\n")
        writeFile.write("             +---- Load Username and Password into memory\n")
        writeFile.write("             |                    |\n")
        writeFile.write("             |     Ask for Username and check if it matches the username in memory\n")
        writeFile.write("             |                    |                           ^\n")
        writeFile.write("             |                    +---- Is it correcct?       |\n")
        writeFile.write("             |                    |            |              |\n")
        writeFile.write("             |                    |           Yes?            |\n")
        writeFile.write("             |                    |            |              |\n")
        writeFile.write("             |                    |<-----------+              |\n")
        writeFile.write("             |                    |            |              |\n")
        writeFile.write("             |                    |           No?             |\n")
        writeFile.write("             |                    |            |              |\n")
        writeFile.write("             |                    |            +--------------+\n")
        writeFile.write("             |                    |\n")
        writeFile.write("             |     Ask for Password and check if it matches the password in memory\n")
        writeFile.write("             |                    |                           ^\n")
        writeFile.write("             |                    +---- Is it correcct?       |\n")
        writeFile.write("             |                    |            |              |\n")
        writeFile.write("             |                    |           Yes?            |\n")
        writeFile.write("             |                    |            |              |\n")
        writeFile.write("             |                    |<-----------+              |\n")
        writeFile.write("             |                    |            |              |\n")
        writeFile.write("             |                    |           No?             |\n")
        writeFile.write("             |                    |            |              |\n")
        writeFile.write("             |                    |            +--------------+\n")
        writeFile.write("             |                    |\n")
        writeFile.write("             |             Display Welcome\n")
        writeFile.write("             |\n")
        writeFile.write("          bash.py\n")
        writeFile.write("             |\n")
        writeFile.write("             +---- Set some enviornment variables\n")
        writeFile.write("                                  |\n")
        writeFile.write("                                  +---- systemvariables.py\n")
        writeFile.write("                                  |\n")
        writeFile.write("                                  |<-------------------------+\n")
        writeFile.write("                                  |                          |\n")
        writeFile.write("                   Input Command and any arguments           |\n")
        writeFile.write("                                  |                          |\n")
        writeFile.write("                   Seperate Command from Arguments           |\n")
        writeFile.write("                                  |                          |\n")
        writeFile.write("                   Check command entered and check it against|list of commands\n")
        writeFile.write("                                  |                          |\n")
        writeFile.write("                                  +---- *.py                 |\n")
        writeFile.write("                                  |                          |\n")
        writeFile.write("                   Does the command match list of commands?  |\n")
        writeFile.write("                                  |                          |\n")
        writeFile.write("                                  +---- No?                  |\n")
        writeFile.write("                                         |                   |\n")
        writeFile.write("                               Display error message         |\n")
        writeFile.write("                                         |                   |\n")
        writeFile.write("                                         +-------------------+")
        writeFile.close()
        os.chdir("..")
    print("Finalizing Installation...")
    os.chdir(path)
    os.mkdir("Temporary Install Files")
    os.chdir("Temporary Install Files")
    tmpInsFil = os.getcwd()
    writeFile = open("shortcut.bat", "w")
    writeFile.write("@echo off\n")
    writeFile.write("echo Set oWS = WScript.CreateObject(\"WScript.Shell\") > CreateShortcut.vbs\n")
    writeFile.write("echo sLinkFile = \"" + path + "\\Startup.lnk\" >> CreateShortcut.vbs\n")
    writeFile.write("echo Set oLink = oWS.CreateShortcut(sLinkFile) >> CreateShortcut.vbs\n")
    writeFile.write("echo oLink.TargetPath = \"" + includeDir + "\\Startup.exe\" >> CreateShortcut.vbs\n")
    writeFile.write("echo oLink.Save >> CreateShortcut.vbs\n")
    writeFile.write("cscript CreateShortcut.vbs\n")
    writeFile.write("del CreateShortcut.vbs\n")
    writeFile.close()
    os.system("shortcut.bat > lnkout")
    os.chdir("..")
    writeFile = open("Readme.txt", "w")
    writeFile.write("==============================================\n")
    writeFile.write("   Bash for Windows: The Bourne Again SHell   \n")
    writeFile.write("==============================================\n")
    writeFile.write(" Welcome to Bash for Windows! First off:      \n")
    writeFile.write(" there isn't really any type of help          \n")
    writeFile.write(" document in Bash for Windows. Bash for       \n")
    writeFile.write(" Windows tries to work as much like the real  \n")
    writeFile.write(" Bash as possible, and as far as I can tell,  \n")
    writeFile.write(" there isn't any sort of help document in     \n")
    writeFile.write(" Bash that tells you commands. The closest    \n")
    writeFile.write(" thing there is to a help document is the man \n")
    writeFile.write(" page, which hasn't been implemented yet. If  \n")
    writeFile.write(" you want to learn Bash, Google is your       \n")
    writeFile.write(" friend.                                      \n")
    writeFile.write("==============================================\n")
    writeFile.write(" Bash for Windows is not exactly like Bash.   \n")
    writeFile.write(" It has taken many hours of my free time to   \n")
    writeFile.write(" get it to where it is as of version 1.0.     \n")
    writeFile.write(" This being said, there are a few things that \n")
    writeFile.write(" work in Bash that don't work in Bash for     \n")
    writeFile.write(" Windows. A few of them are:                  \n")
    writeFile.write("  - \\ then space doesn't put in a space      \n")
    writeFile.write("    - Spaces are exclusivly used to seperate  \n")
    writeFile.write("      the command to an argument to another   \n")
    writeFile.write("      argument.                               \n")
    writeFile.write("  - Bash Scripting doesn't work at all        \n")
    writeFile.write("    - You can't really run any program that is\n")
    writeFile.write("      not in Bash for Windows. You would have \n")
    writeFile.write("      to go back to the command prompt or     \n")
    writeFile.write("      PowerShell                              \n")
    writeFile.write("  - Sudo doesn't execute things as            \n")
    writeFile.write("    Administrator                             \n")
    writeFile.write("    - Would need to learn how to elevate      \n")
    writeFile.write("      permissions in Python                   \n")
    writeFile.write("  - No such thing as Apt, Dnf, Pacman, etc.   \n")
    writeFile.write("    - Tried this. Couldn't figure out how to  \n")
    writeFile.write("      download a file from the internet in a  \n")
    writeFile.write("       new Windows install (Without 3rd Party \n")
    writeFile.write("       program having to be installed first)  \n")
    writeFile.write("  - Cannot pipe the output of a command into  \n")
    writeFile.write("    another file                              \n")
    writeFile.write("  - Many command cannot send output into a    \n")
    writeFile.write("    a file using > or >>                      \n")
    writeFile.write("    - The cat command does this, no other     \n")
    writeFile.write("      command does.                           \n")
    writeFile.write("  - No way to create or alter variables from  \n")
    writeFile.write("    the prompt                                \n")
    writeFile.write("    - You can view all of the systemvariables \n")
    writeFile.write("      from the code, but that is the extent   \n")
    writeFile.write("      of what you can do.                     \n")
    writeFile.write("  - Many other commands in Bash don't work in \n")
    writeFile.write("    Bash for Windows                          \n")
    writeFile.write("==============================================\n")
    writeFile.write(" Bash for Windows's code is avalible on       \n")
    writeFile.write(" GitHub! Either run uname -g from the prompt  \n")
    writeFile.write(" or go to https://bit.ly/2KPHRmu to look at   \n")
    writeFile.write(" the code behind Bash for Windows!            \n")
    writeFile.write("==============================================")
    writeFile.close()
    os.system("copy Readme.txt Bash\\Users\\" + username + "\\Documents\\Readme.txt")
    shutil.rmtree("Temporary Install Files")
    os.system("cls")
    print("Bash for Windows Setup is Complete! To start Bash for Windows,\nExecute the Startup executable,\
 both in the base folder that you installed\nBash for Windows into and in Bash/Bash/Source/Include.\n")
    input("Press Enter to Exit...")
except KeyboardInterrupt:
    os.system("cls")
    print("Bash for Windows Setup Wizard was canceled. Thanks for your intrest! Goodbye!")
    time.sleep(3)
    exit()
'''
This file is under the MIT License.

Copyright 2019-2020 <NAME>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files 
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, 
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
'''

# This is the install script.

# Libraries
import os, platform, time, shutil

def cdCheck(directory):
    if(os.path.exists(directory) == True):
        os.chdir(directory)

def rmCheck(directory):
    if(os.path.exists(directory) == True):
        shutil.rmtree(directory)

# First, let's make sure we are running Windows. This install script doesn't work on anything else.
if(platform.system() != "Windows"):
    print("Bash for Windows is only for Windows. It will not be able to\ninstall on", platform.system() + ". Sorry!")

    # Give the user a chance to read the message, then exit
    time.sleep(5)
    exit()

flag = 0

print("Welcome to Bash for Windows!!! \n\"The Bourne Again SHell\" for Windows Setup Wizard!\n\n")
print("This is a piece of software under the MIT License that makes a bash-like\nenviornment under Windows\
 for people who don't want to use WSL or aren't\nable to run WSL.\n")
input("Press Enter to Continue... ")
os.system("cls")
print("\n\n\nThe following is the MIT License. If you do not agree with this license,\ndon't install Bash\
 for Windows.\n\n")
print("Copyright 2019-2020 <NAME>\n\
\n\
Permission is hereby granted, free of charge, to any person obtaining a copy of\n\
this software and associated documentation files (the \"Software\"), to deal in\n\
the Software without restriction, including without limitation the rights to use,\n\
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\n\
Software, and to permit persons to whom the Software is furnished to do so,\n\
subject to the following conditions:\n\
\n\
The above copyright notice and this permission notice shall be included in all\n\
copies or substantial portions of the Software.\n\
\n\
THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n\
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n\
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n\
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n\
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
accept = input("Do you accept the license above? [y,N] ")
if((accept == "y") or (accept == "Y")):
    flag = 1
if(flag == 0):
    os.system("cls")
    print("Thanks for your intrest in Bash for Windows. Goodbye!")
    time.sleep(3)
    exit()

time.sleep(1)
os.system("cls")
path = ""
while(True):
    print("Which personal folder do you want to install Bash for Windows into?")
    userName = os.environ.get("USERNAME")
    folder = input("")
    path = "C:\\Users\\" + userName + "\\" + folder
    if(os.path.exists("C:\\Users\\" + userName + "\\" + folder) == True):
        break
    else:
        print("\nFolder,", folder + ", doesn't exist.\n")
path = path + "\\Bash for Windows"
time.sleep(1)
os.system("cls")
print("What kind of Installation do you want?\n")
print("(N)ormal Installation : Full installation with all the code intact")
print("(M)inimal Installation: Only copy over Startup.exe, then continue to setup\nthe User Account\n")
mN = input("[m,N] ")
normalInstall = True
if((mN == "m") or (mN == "M")):
    normalInstall = False
os.system("cls")
print("INSTALLATION SUMMARY:")
print("User Accepted License")
if(normalInstall == False):
    print("Minimal Installation Chosen")
else:
    print("Normal Installation Chosen")
print("Installing Bash for Windows to:", path + "\n")
print("You sure you want to install Bash for Windows")
confirm = input("[y,N] ")
if((confirm == "y") or (confirm == "Y")):
    flag = 2
if(flag != 2):
    print("Thanks for your intrest in Bash for Windows. Goodbye!")
    time.sleep(3)
    exit()
currentDir = os.getcwd()
os.system("cls")
try:
    if(os.path.exists(path) == True):
        print("Bash for Windows Setup Wizard has detected that there is already an install at\n" + path + " .\n")
        confirm = input("Do you want Bash for Windows to overwrite this installation? [y,N] ")
        if((confirm == "y") or (confirm == "Y")):
            try:
                os.chdir(path)
                cdCheck("Bash")
                cdCheck("Bash")
                rmCheck("Users")
                cdCheck("Source")
                rmCheck("Include")
                os.chdir(path)
                cdCheck("Bash")
                cdCheck("Bash")
                rmCheck("Settings")
                rmCheck("Source")
                os.chdir(path + "/..")
                shutil.rmtree(path)
            except PermissionError:
                os.system("cls")
                print("ERROR: Setup cannot delete the old Bash for Windows Installation. It either does")
                print("not have permission to do so or another process is currently using it. Make sure")
                print("that you have permission to do things in this folder and that there isn't already")
                print("a program using this folder, e.g. File Explorer, and start Setup again.")
                input("Press Enter to Continue...")
                os.system("cls")
                print("Bash for Windows Setup Wizard was canceled. Thanks for your intrest! Goodbye!")
                time.sleep(5)
                exit()
        else:
            os.system("cls")
            print("Bash for Windows Setup Wizard was canceled. Thanks for your intrest! Goodbye!")
            time.sleep(5)
            exit()
    os.system("cls")
    print("Installing Bash for Windows. This does not take long.\nIf Installation fails, delete:\n" + path + "\n" + "\
and run setup again. To cancel, hit Ctrl + C.\n")
    time.sleep(1)
    print("Creating Directory Structure...")
    os.chdir(path + "\\..")
    os.mkdir("Bash for Windows")
    os.chdir("Bash for Windows")
    os.mkdir("Bash")
    os.mkdir("Bash/Bash")
    os.mkdir("Bash/Users")
    os.mkdir("Bash/Bash/Settings")
    os.mkdir("Bash/Bash/Source")
    os.mkdir("Bash/Bash/Source/Include")
    os.chdir("Bash/Bash/Source/Include")
    print("Getting ready to write files...")
    includeDir = os.getcwd()
    os.chdir(currentDir)
    if(os.path.exists("Startup.exe") == False):
        print("\nERROR: File \"Startup.exe\" in", currentDir, "\ndoesn't exists. Setup cannot continue.")
        input("Press Enter to Quit Setup...")
        os.system("cls")
        print("Bash for Windows Setup failed. Thanks for your intrest! Goodbye!")
        time.sleep(3)
        exit()
    print("Creating files...")
    runStr = "copy Startup.exe \"" + includeDir + "\" > del.txt"
    os.system(runStr)
    os.remove("del.txt")
    if(normalInstall == True):
        os.chdir(includeDir)
        writeFile = open("bash.py", "w")
        writeFile.write("'''\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files\n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# Bash is the script that handles the commands. Most commands it will call on other scripts to get the job done\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("from time import sleep\n")
        writeFile.write("import os, username, ls, cd, systemvariables, pwd, socket, cat\n")
        writeFile.write("import echo, nano, touch, rm, filechk, cp, pushd, popd, mkdir\n")
        writeFile.write("import mv, oschk, repair, tofile\n\n")
        writeFile.write("# Main function. First Set all other system variables\n")
        writeFile.write("def run():\n")
        writeFile.write("    # Check once again to make sure we are running Windows\n")
        writeFile.write("    oschk.check()\n")
        writeFile.write("    os.chdir(systemvariables.exepath)\n")
        writeFile.write("    os.chdir(\"../../../../\")\n")
        writeFile.write("    systemvariables.ROOT = os.getcwd()\n")
        writeFile.write("    os.chdir(\"Bash/Users/\" + systemvariables.usrsession)\n")
        writeFile.write("    systemvariables.HOME = os.getcwd()\n")
        writeFile.write("    if(os.path.exists(\"Documents\") == False):\n")
        writeFile.write("        print(\"Unfortunatly, Bash for Windows cannot find your documents.\")\n")
        writeFile.write("        prompt = input(\"Do you want to try to repair the problem? [Y,n] \")\n")
        writeFile.write("        if(prompt == \"n\"):\n")
        writeFile.write("            print(\"Abort.\")\n")
        writeFile.write("            systemvariables.USRDOCS = \"null\"\n")
        writeFile.write("        elif(prompt == \"N\"):\n")
        writeFile.write("            print(\"Abort.\")\n")
        writeFile.write("            systemvariables.USRDOCS = \"null\"\n")
        writeFile.write("        else:\n")
        writeFile.write("            success = repair.docs()\n")
        writeFile.write("            if(success == True):\n")
        writeFile.write("                os.chdir(\"Documents\")\n")
        writeFile.write("                systemvariables.USRDOCS = os.getcwd()\n")
        writeFile.write("    else:\n")
        writeFile.write("        os.chdir(\"Documents\")\n")
        writeFile.write("        systemvariables.USRDOCS = os.getcwd()\n")
        writeFile.write("    os.chdir(systemvariables.settingspath)\n")
        writeFile.write("    systemvariables.settingspath = os.getcwd()\n")
        writeFile.write("    os.chdir(\"Settings\")\n")
        writeFile.write("    systemvariables.loginfopath = os.getcwd()\n")
        writeFile.write("    os.chdir(\"../Source\")\n")
        writeFile.write("    systemvariables.srcpath = os.getcwd()\n")
        writeFile.write("    os.chdir(\"../../Users\")\n")
        writeFile.write("    systemvariables.usrpath = os.getcwd()\n")
        writeFile.write("    os.chdir(\"..\")\n")
        writeFile.write("    systemvariables.bshpath = os.getcwd()\n")
        writeFile.write("    zzz = 1\n\n")
        writeFile.write("    # Get user name\n")
        writeFile.write("    cd.go(\"/\")\n")
        writeFile.write("    user = open(\"Bash/Bash/Settings/ivhzadgz.bws\", \"r\")\n")
        writeFile.write("    usr = user.read()\n")
        writeFile.write("    user.close()\n\n")
        writeFile.write("    # Get back to \"Home\" folder\n")
        writeFile.write("    cd.go(\"~\")\n")
        writeFile.write("    # Reset the lastdir variable\n")
        writeFile.write("    systemvariables.lastdir = \"\"\n\n")
        writeFile.write("    # Do this until told to exit\n")
        writeFile.write("    while(zzz == 1):\n")
        writeFile.write("        # Change display depending on where the user is in the file system\n")
        writeFile.write("        if(os.getcwd() == systemvariables.ROOT):\n")
        writeFile.write("            display = \"/\"\n")
        writeFile.write("        elif(os.getcwd() == systemvariables.HOME):\n")
        writeFile.write("            display = \"~\"\n")
        writeFile.write("        elif(os.getcwd() == systemvariables.USRDOCS):\n")
        writeFile.write("            display = \"~/Documents\"\n")
        writeFile.write("        elif(os.getcwd() == systemvariables.settingspath):\n")
        writeFile.write("            display = \"/Bash/Bash\"\n")
        writeFile.write("        elif(os.getcwd() == systemvariables.loginfopath):\n")
        writeFile.write("            display = \"/Bash/Bash/Settings\"\n")
        writeFile.write("        elif(os.getcwd() == systemvariables.srcpath):\n")
        writeFile.write("            display = \"/Bash/Bash/Source\"\n")
        writeFile.write("        elif(os.getcwd() == systemvariables.usrpath):\n")
        writeFile.write("            display = \"/Bash/Users\"\n")
        writeFile.write("        elif(os.getcwd() == systemvariables.exepath):\n")
        writeFile.write("            display = \"/Bash/Bash/Source/Include\"\n")
        writeFile.write("        elif(os.getcwd() == systemvariables.bshpath):\n")
        writeFile.write("            display = \"/Bash\"\n")
        writeFile.write("        else:\n")
        writeFile.write("            display = os.getcwd()\n\n")
        writeFile.write("        # Prompt\n")
        writeFile.write("        command = input(usr + \"@\" + socket.gethostname() + \":\" + display + \" $ \")\n\n")
        writeFile.write("        # Find a space. If one is found, put it in another variable.\n")
        writeFile.write("        args = command.find(\" \", 0, len(command))\n")
        writeFile.write("        argsArr = ['']\n\n")
        writeFile.write("        # Counters\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        j = 0\n")
        writeFile.write("        k = 0\n\n")
        writeFile.write("        # Only do it if there is indeed a space\n")
        writeFile.write("        if(args != -1):\n")
        writeFile.write("            for i in command:\n")
        writeFile.write("                # Only do this after a space\n")
        writeFile.write("                if(j > args):\n")
        writeFile.write("                    # If we come across a space, add an item to the array of arguments and skip the rest\n")
        writeFile.write("                    if(i == \" \"):\n")
        writeFile.write("                        k += 1\n")
        writeFile.write("                        argsArr.append(\"\")\n")
        writeFile.write("                        continue\n\n")
        writeFile.write("                    # Take the current item in the args array and put in each character of the input\n")
        writeFile.write("                    # string, then delete that same character from the input string\n")
        writeFile.write("                    argsArr[k] = argsArr[k] + i\n")
        writeFile.write("                    command = command[0 : j : ]\n")
        writeFile.write("                else:\n")
        writeFile.write("                    j += 1\n")
        writeFile.write("        # Reset the counters\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        j = 0\n")
        writeFile.write("        k = 0\n\n")
        writeFile.write("        # If we have at least 1 space, make sure you take out the last character\n")
        writeFile.write("        # in the command variable that happens to be a space\n")
        writeFile.write("        if(args != -1):\n")
        writeFile.write("            command = command[:-1:]\n\n")
        writeFile.write("        # Run the command. If it dosen't exist, display a message\n")
        writeFile.write("        if(command == \"exit\"):\n")
        writeFile.write("            zzz = 0\n")
        writeFile.write("        elif(command == \"ls\"):\n")
        writeFile.write("            ls.show(argsArr)\n")
        writeFile.write("        elif(command == \"cd\"):\n")
        writeFile.write("            cd.go(argsArr)\n")
        writeFile.write("        elif(command == \"pwd\"):\n")
        writeFile.write("            out = os.getcwd()\n")
        writeFile.write("            flag = 0\n")
        writeFile.write("            if(\">>\" in argsArr):\n")
        writeFile.write("                flag = 1\n")
        writeFile.write("                tofile.write(\">>\", out, argsArr[1])\n")
        writeFile.write("            elif(\">\" in argsArr):\n")
        writeFile.write("                if(flag == 0):\n")
        writeFile.write("                    tofile.write(\">\", out, argsArr[1])\n")
        writeFile.write("            else:\n")
        writeFile.write("                print(out)\n")
        writeFile.write("        elif(command == \"cat\"):\n")
        writeFile.write("            cat.show(argsArr)\n")
        writeFile.write("        elif(command == \"nano\"):\n")
        writeFile.write("            file = argsArr\n")
        writeFile.write("            nano.write(file) \n")
        writeFile.write("        elif(command == \"vi\"):\n")
        writeFile.write("            file = argsArr\n")
        writeFile.write("            nano.write(file) \n")
        writeFile.write("        elif(command == \"vim\"):\n")
        writeFile.write("            file = argsArr\n")
        writeFile.write("            nano.write(file) \n")
        writeFile.write("        elif(command == \"emacs\"):\n")
        writeFile.write("            file = argsArr\n")
        writeFile.write("            nano.write(file) \n")
        writeFile.write("        elif(command == \"clear\"):\n")
        writeFile.write("            os.system(\"cls\")\n")
        writeFile.write("        elif(command == \"lsvar\"):\n")
        writeFile.write("            ls.vars(argsArr)\n")
        writeFile.write("        elif(command == \"echo\"):\n")
        writeFile.write("            echo.reg(argsArr)\n")
        writeFile.write("        elif(command == \"touch\"):\n")
        writeFile.write("            touch.write(argsArr)\n")
        writeFile.write("        elif(command == \"rm\"):\n")
        writeFile.write("            rm.remove(argsArr)\n")
        writeFile.write("        elif(command == \"mv\"):\n")
        writeFile.write("            file = argsArr[0]\n")
        writeFile.write("            dstfile = argsArr[1]\n")
        writeFile.write("            mv.move(file, dstfile)\n")
        writeFile.write("        elif(command == \"cp\"):\n")
        writeFile.write("            file = argsArr[0]\n")
        writeFile.write("            newfile = argsArr[1]\n")
        writeFile.write("            cp.copy(file, newfile)\n")
        writeFile.write("        elif(command == \"pushd\"):\n")
        writeFile.write("            path = argsArr\n")
        writeFile.write("            pushd.go(path)\n")
        writeFile.write("        elif(command == \"popd\"):\n")
        writeFile.write("            popd.go()\n")
        writeFile.write("        elif(command == \"uname\"):\n")
        writeFile.write("            if(argsArr[0] == \"-g\"):\n")
        writeFile.write("                print(\"Bash for Windows: The Bourne Again Shell! Version 1.2.1.1\")\n")
        writeFile.write("                print(\"Taking you to the GitHub page...\")\n")
        writeFile.write("                os.system(\"iexplore https://github.com/JR-Tech-and-Software/Bash-for-Windows\")\n")
        writeFile.write("            else:\n")
        writeFile.write("                print(\"Bash for Windows: The Bourne Again Shell! Version 1.2.1.1\")\n")
        writeFile.write("                print(\"\\nAll the code is avalible at GitHub! Check it out! Use the -g argument\")\n")
        writeFile.write("                print(\"to be taken to the page!\\n\\nBash for Windows is under the MIT License.\")\n")
        writeFile.write("                print(\"Check it out on GitHub as well.\")\n")
        writeFile.write("        elif(command == \"mkdir\"):\n")
        writeFile.write("            mkdir.create(argsArr)\n")
        writeFile.write("        else:\n")
        writeFile.write("            if(command == \"\"):\n")
        writeFile.write("                sleep(0)\n")
        writeFile.write("            else:\n")
        writeFile.write("                if(os.path.exists(os.getcwd() + \"/\" + command) == True):\n")
        writeFile.write("                    typee = argsArr[0]\n")
        writeFile.write("                if(typee == \"exe\"):\n")
        writeFile.write("                    os.system(command)\n")
        writeFile.write("                elif(typee == \"py\"):\n")
        writeFile.write("                    os.system(\"py \" + command)\n")
        writeFile.write("                else:\n")
        writeFile.write("                    print(command + \": command not found\")\n")
        writeFile.write("    exit()\n\n")
        writeFile.write("# More checking for other scripts to use\n")
        writeFile.write("def usrcheck():\n")
        writeFile.write("    incorrect = True\n")
        writeFile.write("    while(incorrect == True):\n")
        writeFile.write("        user = open(\"Settings/ivhzadgz.bws\", \"r\")\n")
        writeFile.write("        userguess = input(\"Type a user name # \")\n")
        writeFile.write("        if(userguess == user.read()):\n")
        writeFile.write("            incorrect = False\n")
        writeFile.write("        else:\n")
        writeFile.write("            print(\"Incorrect Username.\")\n")
        writeFile.write("    user.close()\n")
        writeFile.write("def passcheck():\n")
        writeFile.write("        incorrect = True\n")
        writeFile.write("        while(incorrect == True):\n")
        writeFile.write("            password = open(\"Settings/kvnnadgz.bws\", \"r\")\n")
        writeFile.write("            passguess = input(\"password # \")\n")
        writeFile.write("            if(passguess == password.read()):\n")
        writeFile.write("                incorrect = False\n")
        writeFile.write("            else:\n")
        writeFile.write("                print(\"Incorrect Password.\")\n")
        writeFile.write("        password.close()\n")
        writeFile.write("# If the end user tries to run bash.py without Startup.py, then display this message\n")
        writeFile.write("print(\"This file isn't ment to be run by itself. To run Bash for Windows,\")\n")
        writeFile.write("print(\"run the Startup program.\")\n")
        writeFile.close()
        writeFile = open("cat.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# Cat is a basic script to show the contents of a file\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os, touch, rm, tofile\n\n")
        writeFile.write("# Main Function. First check if the file exists\n")
        writeFile.write("def show(args):\n")
        writeFile.write("    file = args[0]\n")
        writeFile.write("    output = \"\"\n")
        writeFile.write("    firstLetter = \"\"\n")
        writeFile.write("    flag = 0\n\n")
        writeFile.write("    # Make sure the requested file exists and is indeed a file and not a folder.\n")
        writeFile.write("    if(os.path.exists(file) == False):\n")
        writeFile.write("        print(\"cat: \" + file + \" file not found\")\n")
        writeFile.write("    elif(os.path.isdir(file) == True):\n")
        writeFile.write("        print(\"cat: \" + file + \": Is a directory\")\n")
        writeFile.write("    else:\n")
        writeFile.write("        show = open(file)\n")
        writeFile.write("        output = show.read()\n")
        writeFile.write("        show.close()\n")
        writeFile.write("        # If told to do so, either append or overwrite a file where we send all output to\n")
        writeFile.write("        if(\">>\" in args):\n")
        writeFile.write("            i = 0\n")
        writeFile.write("            index = 0\n")
        writeFile.write("            flag = 1\n")
        writeFile.write("            for j in args:\n")
        writeFile.write("                if(i == 0):\n")
        writeFile.write("                    i += 1\n")
        writeFile.write("                    continue\n")
        writeFile.write("                if(args[i] == \">>\"):\n")
        writeFile.write("                    index = i + 1\n")
        writeFile.write("                    break\n")
        writeFile.write("                i += 1\n")
        writeFile.write("            tofile.write(\">>\", output, args[index])\n")
        writeFile.write("        elif(\">\" in args):\n")
        writeFile.write("            if(flag == 0):\n")
        writeFile.write("                i = 0\n")
        writeFile.write("                index = 0\n")
        writeFile.write("                for j in args:\n")
        writeFile.write("                    if(i == 0):\n")
        writeFile.write("                        i += 1\n")
        writeFile.write("                        continue\n")
        writeFile.write("                    if(args[i] == \">\"):\n")
        writeFile.write("                        index = i + 1\n")
        writeFile.write("                        break\n")
        writeFile.write("                    i += 1\n")
        writeFile.write("                tofile.write(\">\", output, args[index])\n")
        writeFile.write("        # If not told to send output to a file, print to screen.\n")
        writeFile.write("        else:\n")
        writeFile.write("            print(output)\n")
        writeFile.close()
        writeFile = open("cd.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# cd is a basic script that deciphers tildas and slashes then goes into desired directory\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os\n")
        writeFile.write("import systemvariables\n\n")
        writeFile.write("# Variable\n")
        writeFile.write("currentdir = \"\"\n\n")
        writeFile.write("# Main Function\n")
        writeFile.write("def go(args):\n")
        writeFile.write("    path = args[0]\n")
        writeFile.write("    currentdir = os.getcwd()\n")
        writeFile.write("    otherdir = systemvariables.lastdir\n\n")
        writeFile.write("    # If we have inputed something special, go to a special place.\n")
        writeFile.write("    # If not, go to where directed.\n")
        writeFile.write("    if(path == \"~\"):\n")
        writeFile.write("        os.chdir(systemvariables.HOME)\n")
        writeFile.write("    elif(path == \"-\"):\n")
        writeFile.write("        os.chdir(systemvariables.lastdir)\n")
        writeFile.write("    elif(path == \"/\"):\n")
        writeFile.write("        os.chdir(systemvariables.ROOT)\n")
        writeFile.write("    elif(path == \"$settingspath\"):\n")
        writeFile.write("        os.chdir(systemvariables.settingspath)\n")
        writeFile.write("    elif(path == \"$exepath\"):\n")
        writeFile.write("        os.chdir(systemvariables.exepath)\n")
        writeFile.write("    elif(path == \"/Bash\"):\n")
        writeFile.write("        os.chdir(systemvariables.bshpath)\n")
        writeFile.write("    elif(path == \"/Bash/Bash\"):\n")
        writeFile.write("        os.chdir(systemvariables.settingspath)\n")
        writeFile.write("    elif(path == \"/Bash/Users\"):\n")
        writeFile.write("        os.chdir(systemvariables.usrpath)\n")
        writeFile.write("    elif(path == \"/Bash/Bash/Settings\"):\n")
        writeFile.write("        os.chdir(systemvariables.loginfopath)\n")
        writeFile.write("    elif(path == \"/Bash/Bash/Source\"):\n")
        writeFile.write("        os.chdir(systemvariables.srcpath)\n")
        writeFile.write("    elif(path == \"/Bash/Bash/Source/Include\"):\n")
        writeFile.write("        os.chdir(systemvariables.exepath)\n")
        writeFile.write("    elif(path == \"$bshpath\"):\n")
        writeFile.write("        os.chdir(systemvariables.bshpath)\n")
        writeFile.write("    elif(path == \"$usrpath\"):\n")
        writeFile.write("        os.chdir(systemvariables.usrpath)\n")
        writeFile.write("    elif(path == \"$loginfopath\"):\n")
        writeFile.write("        os.chdir(systemvariables.loginfopath)\n")
        writeFile.write("    elif(path == \"$srcpath\"):\n")
        writeFile.write("        os.chdir(systemvariables.srcpath)\n")
        writeFile.write("    elif(path == \"$USRDOCS\"):\n")
        writeFile.write("        if(systemvariables.USRDOCS == \"null\"):\n")
        writeFile.write("            print(\"bash: cd: null: No such file or directory\")\n")
        writeFile.write("        else:\n")
        writeFile.write("            os.chdir(systemvariables.USRDOCS)\n")
        writeFile.write("    else:\n")
        writeFile.write("        if(path == \"\"):\n")
        writeFile.write("            go(\"~\")\n")
        writeFile.write("        else:\n")
        writeFile.write("            if(os.path.exists(path) == True):\n")
        writeFile.write("                os.chdir(path)\n")
        writeFile.write("            else:\n")
        writeFile.write("                print(\"bash: cd:\", path + \": No such file or directory\")\n")
        writeFile.write("    # Set the lastdir system variable\n")
        writeFile.write("    systemvariables.lastdir = currentdir\n\n")
        writeFile.write("    if(os.getcwd() == systemvariables.lastdir):\n")
        writeFile.write("        systemvariables.lastdir = otherdir")
        writeFile.close()
        writeFile = open("echo.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# echo is a basic script the either echos text given or outputs a variable\n\n")
        writeFile.write("# Import the system variables (to output if asked to)\n")
        writeFile.write("import systemvariables, tofile\n\n")
        writeFile.write("# Main Function. Commented lines are for debugging purposes only. First set a couple of variables\n")
        writeFile.write("def reg(args):\n")
        writeFile.write("    string = args[0]\n")
        writeFile.write("    stringprt = string\n")
        writeFile.write("    ifvar = False\n")
        writeFile.write("    i = 0\n")
        writeFile.write("    endstring = \"\"\n\n")
        writeFile.write("    # See if the first character of a string is a dollar sign, the symbol that declares the want of a\n")
        writeFile.write("    # system variable\n")
        writeFile.write("    if(stringprt.find(\"$\", 0, 1) == 0):\n")
        writeFile.write("        ifvar = True\n")
        writeFile.write("    else:\n")
        writeFile.write("        ifvar = False\n\n")
        writeFile.write("    # If there is a dollar sign, find out what variable we want and print it out. If not, print out\n")
        writeFile.write("    # inputted text\n\n")
        writeFile.write("    for j in args:\n")
        writeFile.write("        if((args[i] == \">\") or (args[i] == \">>\")):\n")
        writeFile.write("            break\n")
        writeFile.write("        if(ifvar == True):\n")
        writeFile.write("            newstr = stringprt[1:]\n")
        writeFile.write("            if((((((newstr == \"usrsession\") or (newstr == \"HOME\")) or (newstr == \"exepath\")) or (newstr == \"USRDOCS\")) or (newstr == \"ROOT\")) or (newstr == \"settingspath\") or (newstr == \"srcpath\") or (newstr == \"loginfopath\") or (newstr == \"usrpath\") or (newstr == \"bshpath\") or (newstr == \"lastdir\")):\n")
        writeFile.write("                if(newstr == \"usrsession\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + " " + systemvariables.usrsession\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.usrsession\n")
        writeFile.write("                elif(newstr == \"HOME\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + " " + systemvariables.HOME\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.HOME\n")
        writeFile.write("                elif(newstr == \"exepath\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + \" \" + systemvariables.exepath\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.exepath\n")
        writeFile.write("                elif(newstr == \"USRDOCS\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + \" \" + systemvariables.USRDOCS\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.USRDOCS\n")
        writeFile.write("                elif(newstr == \"settingspath\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + " " + systemvariables.settingspath\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.settingspath\n")
        writeFile.write("                elif(newstr == \"loginfopath\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + \" \" + systemvariables.loginfopath\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.loginfopath\n")
        writeFile.write("                elif(newstr == \"srcpath\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + \" \" + systemvariables.srcpath\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.srcpath\n")
        writeFile.write("                elif(newstr == \"usrpath\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + \" \" + systemvariables.usrpath\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.usrpath\n")
        writeFile.write("                elif(newstr == \"bshpath\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + \" \" + systemvariables.bshpath\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.bshpath\n")
        writeFile.write("                elif(newstr == \"lastdir\"):\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + \" \" + systemvariables.lastdir\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.lastdir\n")
        writeFile.write("                else:\n")
        writeFile.write("                    if(endstring != \"\"):\n")
        writeFile.write("                        endstring = endstring + \" \" + systemvariables.ROOT\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        endstring = systemvariables.ROOT\n")
        writeFile.write("            else:\n")
        writeFile.write("                if(endstring != \"\"):\n")
        writeFile.write("                    endstring = endstring + \" \" + args[i]\n")
        writeFile.write("                else:\n")
        writeFile.write("                    endstring = args[i]\n")
        writeFile.write("        else:\n")
        writeFile.write("            if(endstring != \"\"):\n")
        writeFile.write("                endstring = endstring + \" \" + args[i]\n")
        writeFile.write("            else:\n")
        writeFile.write("                endstring = args[i]\n")
        writeFile.write("        i += 1\n")
        writeFile.write("    flag = 0\n")
        writeFile.write("    if(\">>\" in args):\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        index = 0\n")
        writeFile.write("        flag = 1\n")
        writeFile.write("        for k in args:\n")
        writeFile.write("            if(i == 0):\n")
        writeFile.write("                i += 1\n")
        writeFile.write("                continue\n")
        writeFile.write("            if(args[i] == \">>\"):\n")
        writeFile.write("                index = i + 1\n")
        writeFile.write("                break\n")
        writeFile.write("            i += 1\n")
        writeFile.write("        tofile.write(\">>\", endstring, args[index])\n")
        writeFile.write("    elif(\">\" in args):\n")
        writeFile.write("        if(flag == 0):\n")
        writeFile.write("            i = 0\n")
        writeFile.write("            index = 0\n")
        writeFile.write("            for k in args:\n")
        writeFile.write("                if(i == 0):\n")
        writeFile.write("                    i += 1\n")
        writeFile.write("                    continue\n")
        writeFile.write("                if(args[i] == \">\"):\n")
        writeFile.write("                    index = i + 1\n")
        writeFile.write("                    break\n")
        writeFile.write("                i += 1\n")
        writeFile.write("            tofile.write(\">\", endstring, args[index])\n")
        writeFile.write("    else:\n")
        writeFile.write("        # If not told to send endstring to a file, print to screen.\n")
        writeFile.write("        print(endstring)")
        writeFile.close()
        writeFile = open("filechk.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# Code is used often, so I created a library for it. If the requested file exists, return True. If not, return False\n\n")
        writeFile.write("# Uses the ls library to get list of all the files in the directory to look through\n")
        writeFile.write("import ls\n\n")
        writeFile.write("# Main function\n")
        writeFile.write("def check(filename):\n")
        writeFile.write("    directory = ls.list()\n")
        writeFile.write("    if(any(filename in s for s in directory)):\n")
        writeFile.write("        return True\n")
        writeFile.write("    else:\n")
        writeFile.write("        return False")
        writeFile.close()
        writeFile = open("ls.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# ls is a basic script that either outputs the files in a directory or returns a list of files in the current\n")
        writeFile.write("# directory\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("from os import walk\n")
        writeFile.write("import os, glob, systemvariables, tofile\n\n")
        writeFile.write("# Function that prints out all files 1 by 1 virtically without any other characters on the screen\n")
        writeFile.write("def show(args):\n")
        writeFile.write("    # Store all output in a variable\n")
        writeFile.write("    output = \"\"\n\n")
        writeFile.write("    # If we don't request to list the current directory and don't want to send output of current\n")
        writeFile.write("    # directory to file, do the following:\n")
        writeFile.write("    if((args[0] != \"\") and ((args[0] != \">\") and (args[0] != \">>\"))):\n")
        writeFile.write("        # Make sure the directory requested exists and that it is a directory\n")
        writeFile.write("        if((os.path.exists(args[0]) == True) and (os.path.isdir(args[0]) == True)):\n")
        writeFile.write("            # Remember what directory we are currently in then change to the requested directory.\n")
        writeFile.write("            lastDir = os.getcwd()\n")
        writeFile.write("            os.chdir(args[0])\n\n")
        writeFile.write("            # Get a listing fo what is in the directory, then list them in a fancy way\n")
        writeFile.write("            dir_list = os.listdir(os.getcwd())\n")
        writeFile.write("            hold = []\n")
        writeFile.write("            i = 0\n")
        writeFile.write("            j = 0\n")
        writeFile.write("            for dirs in dir_list:\n")
        writeFile.write("                if(os.path.isdir(dir_list[i]) == True):\n")
        writeFile.write("                    if(i == len(dir_list) - 1):\n")
        writeFile.write("                        output = output + dir_list[i] + \" [DIR]\"\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        output = output + dir_list[i] + \" [DIR]\\n\"\n")
        writeFile.write("                else:\n")
        writeFile.write("                    hold.append(dir_list[i])\n")
        writeFile.write("                i += 1\n")
        writeFile.write("            for k in hold:\n")
        writeFile.write("                if(j == len(hold) - 1):\n")
        writeFile.write("                    output = output + hold[j]\n")
        writeFile.write("                else:\n")
        writeFile.write("                    output = output + hold[j] + \"\\n\"\n")
        writeFile.write("                j += 1\n\n")
        writeFile.write("            # Go to the directory we were just in.\n")
        writeFile.write("            os.chdir(lastDir)\n\n")
        writeFile.write("            # If asked to do so, send output to a file. Either overwrite a file or append to it.\n")
        writeFile.write("            if(\">>\" in args):\n")
        writeFile.write("                i = 0\n")
        writeFile.write("                index = 0\n")
        writeFile.write("                for j in args:\n")
        writeFile.write("                    if(i == 0):\n")
        writeFile.write("                        i += 1\n")
        writeFile.write("                        continue\n")
        writeFile.write("                    if(args[i] == \">>\"):\n")
        writeFile.write("                        index = i + 1\n")
        writeFile.write("                        break\n")
        writeFile.write("                    i += 1\n")
        writeFile.write("                tofile.write(\">>\", output, args[index])\n")
        writeFile.write("            elif(\">\" in args):\n")
        writeFile.write("                i = 0\n")
        writeFile.write("                index = 0\n")
        writeFile.write("                for j in args:\n")
        writeFile.write("                    if(i == 0):\n")
        writeFile.write("                        i += 1\n")
        writeFile.write("                        continue\n")
        writeFile.write("                    if(args[i] == \">\"):\n")
        writeFile.write("                        index = i + 1\n")
        writeFile.write("                        break\n")
        writeFile.write("                    i += 1\n")
        writeFile.write("                tofile.write(\">\", output, args[index])\n")
        writeFile.write("            # If we don't want to send output of command to a file, print the output to the screen.\n")
        writeFile.write("            else:\n")
        writeFile.write("                print(output)\n")
        writeFile.write("        else:\n")
        writeFile.write("            # Error Message: if it is a file repeat file name\n")
        writeFile.write("            if(os.path.isfile(args[0]) == True):\n")
        writeFile.write("                print(args[0])\n")
        writeFile.write("            else:\n")
        writeFile.write("                print(\"ls: cannot access '\" + args[0] + \"': No such file or directory\")\n\n")
        writeFile.write("    # Either print listing of current directory or send output of command to file.\n")
        writeFile.write("    # Pretty much the same as before.\n")
        writeFile.write("    elif((args[0] == \"\") or (args[0] == \">\") or args[0] == \">>\"):\n")
        writeFile.write("        dir_list = os.listdir(os.getcwd())\n")
        writeFile.write("        hold = []\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        j = 0\n")
        writeFile.write("        for dirs in dir_list:\n")
        writeFile.write("            #print(os.path.isdir(str(dir_list[i])))\n")
        writeFile.write("            if(os.path.isdir(dir_list[i]) == True):\n")
        writeFile.write("                if(os.path.isdir(dir_list[i]) == True):\n")
        writeFile.write("                    if(i == len(dir_list) - 1):\n")
        writeFile.write("                        if(len(hold) == 0):\n")
        writeFile.write("                            output = output + dir_list[i] + \" [DIR]\"\n")
        writeFile.write("                        else:\n")
        writeFile.write("                            output = output + dir_list[i] + \" [DIR]\\n\"\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        output = output + dir_list[i] + \" [DIR]\\n\"\n")
        writeFile.write("            else:\n")
        writeFile.write("                hold.append(dir_list[i])\n")
        writeFile.write("            i += 1\n")
        writeFile.write("        for k in hold:\n")
        writeFile.write("            if(j == len(hold) - 1):\n")
        writeFile.write("                output = output + hold[j]\n")
        writeFile.write("            else:\n")
        writeFile.write("                output = output + hold[j] + \"\\n\"\n")
        writeFile.write("            j += 1\n\n")
        writeFile.write("        if(\">>\" in args):\n")
        writeFile.write("            tofile.write(\">>\", output, args[1])\n")
        writeFile.write("        elif(\">\" in args):\n")
        writeFile.write("            tofile.write(\">\", output, args[1])\n")
        writeFile.write("        else:\n")
        writeFile.write("            print(output)\n")
        writeFile.write("# Function that returns a list of everything in the current directory\n")
        writeFile.write("def list():\n")
        writeFile.write("    theList = os.listdir(os.getcwd())\n")
        writeFile.write("    return theList\n\n")
        writeFile.write("# Function that prints out all of the variables, unlike the echo script that only prints out 1 requested\n")
        writeFile.write("# variable\n")
        writeFile.write("def vars(args):\n")
        writeFile.write("    output = \"\"\n")
        writeFile.write("    output = output + \"usrsession: \" + systemvariables.usrsession + \"\\n\"\n")
        writeFile.write("    output = output + \"HOME: \" + systemvariables.HOME + \"\\n\"\n")
        writeFile.write("    output = output + \"ROOT: \" + systemvariables.ROOT + \"\\n\"\n")
        writeFile.write("    output = output + \"exepath: \" + systemvariables.exepath + \"\\n\"\n")
        writeFile.write("    output = output + \"USRDOCS: \" + systemvariables.USRDOCS + \"\\n\"\n")
        writeFile.write("    output = output + \"settingspath: \" + systemvariables.settingspath + \"\\n\"\n")
        writeFile.write("    output = output + \"loginfopath: \" + systemvariables.loginfopath + \"\\n\"\n")
        writeFile.write("    output = output + \"srcpath: \" + systemvariables.srcpath + \"\\n\"\n")
        writeFile.write("    output = output + \"bshpath: \" + systemvariables.bshpath + \"\\n\"\n")
        writeFile.write("    output = output + \"lastdir: \" + systemvariables.lastdir + \"\\n\"\n")
        writeFile.write("    output = output + \"directorystack: \" + str(systemvariables.directorystack)\n")
        writeFile.write("    flag = 0\n")
        writeFile.write("    if(\">>\" in args):\n")
        writeFile.write("        flag = 1\n")
        writeFile.write("        tofile.write(\">>\", output, args[1])\n")
        writeFile.write("    elif(\">\" in args):\n")
        writeFile.write("        if(flag == 0):\n")
        writeFile.write("            tofile.write(\">\", output, args[1])\n")
        writeFile.write("    else:\n")
        writeFile.write("        print(output)")
        writeFile.close()
        
        writeFile = open("mkdir.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n\n")
        writeFile.write("# mkdir simply makes directories, but is written as a seperate script to take advantage of multiple arguments\n\n")
        writeFile.write("# Library\n")
        writeFile.write("import os\n\n")
        writeFile.write("# Main Function\n")
        writeFile.write("def create(args):\n")
        writeFile.write("    # If we recieved -p in an argument, do the following:\n")
        writeFile.write("    if(\"-p\" in args):\n")
        writeFile.write("        # Figure out where the -p argument is so that we can find what path it is talking about\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        index = 0\n")
        writeFile.write("        for j in args:\n")
        writeFile.write("            if(args[i] == \"-p\"):\n")
        writeFile.write("                index = i\n")
        writeFile.write("                break\n")
        writeFile.write("            i += 1\n")
        writeFile.write("        if(index == 0):\n")
        writeFile.write("            index += 1\n")
        writeFile.write("        else:\n")
        writeFile.write("            index -= 1\n")
        writeFile.write("        path = args[index]\n\n")
        writeFile.write("        # Reset and create some counters\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        j = \"\"\n")
        writeFile.write("        k = 0\n\n")
        writeFile.write("        # Array of directories\n")
        writeFile.write("        directories = [\"\"]\n\n")
        writeFile.write("        # Add all the directories we need to go into or create to that array\n")
        writeFile.write("        for j in path:\n")
        writeFile.write("            if(path[i] == \"/\"):\n")
        writeFile.write("                directories.append(\"\")\n")
        writeFile.write("                k += 1\n")
        writeFile.write("                i += 1\n")
        writeFile.write("                continue\n")
        writeFile.write("            directories[k] = directories[k] + j\n")
        writeFile.write("            i += 1\n\n")
        writeFile.write("        # Reset our counters, we'll need them again.\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        j = 0\n\n")
        writeFile.write("        # Remember what directory we are in right now\n")
        writeFile.write("        lastDir = os.getcwd()\n\n")
        writeFile.write("        # Go and create the directories stored in that array\n")
        writeFile.write("        for j in directories:\n")
        writeFile.write("            if(os.path.exists(j) == True):\n")
        writeFile.write("                os.chdir(j)\n")
        writeFile.write("            else:\n")
        writeFile.write("                os.mkdir(j)\n")
        writeFile.write("                os.chdir(j)\n\n")
        writeFile.write("        # Go back to our initial directory\n")
        writeFile.write("        os.chdir(lastDir)\n")
        writeFile.write("    else:\n\n")
        writeFile.write("        # Simply make the directories provided\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        for j in args:\n")
        writeFile.write("            os.mkdir(args[i])\n")
        writeFile.write("            i += 1")
        writeFile.close()

        writeFile = open("mv.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n\n")
        writeFile.write("# mv is a file to move files or rename files, as a new file to help with multiple arguments\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os\n")
        writeFile.write("import filechk\n\n")
        writeFile.write("# Main Function\n")
        writeFile.write("def move(file, dstfile):\n")
        writeFile.write("    # Create some counters\n")
        writeFile.write("    holder = \"\"\n")
        writeFile.write("    i = 0\n")
        writeFile.write("    j = 0\n\n")
        writeFile.write("    # If we have a /, we need to move the file into a directory\n")
        writeFile.write("    if(dstfile.find(\"/\") != -1):\n\n")
        writeFile.write("        # Figure out what directories we need to go through for the destination\n")
        writeFile.write("        for i in dstfile:\n")
        writeFile.write("            if(dstfile[j] == \"/\"):\n")
        writeFile.write("                break\n")
        writeFile.write("            holder = holder + dstfile[j]\n")
        writeFile.write("            j += 1\n\n")
        writeFile.write("    # Make sure the path exists\n")
        writeFile.write("    if(filechk.check(file) == True):\n\n")
        writeFile.write("        # If we are told to move it into a directory, make sure it is a directory\n")
        writeFile.write("        if(os.path.isdir(holder) == True):\n")
        writeFile.write("            os.rename(file, dstfile)\n")
        writeFile.write("        else:\n")
        writeFile.write("            # Error message, or rename the file\n")
        writeFile.write("            if(holder != \"\"):\n")
        writeFile.write("                print(\"mv: cannot move '\" + file + \"' to '\" + dstfile + \"': No such file or directory\")\n")
        writeFile.write("            else:\n")
        writeFile.write("                os.rename(file, dstfile)\n")
        writeFile.write("    else:\n")
        writeFile.write("        # Error message\n")
        writeFile.write("        print(\"mv: cannot stat '\" + file + \": No such file or directory\")")
        writeFile.close()

        writeFile = open("nano.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# nano is a basic script that opens a file in notepad. The nano script does NOT try to imitate the real GNU Nano\n")
        writeFile.write("# text editor.\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os\n")
        writeFile.write("import touch\n")
        writeFile.write("import ls\n\n")
        writeFile.write("# Main Function. First get a listing of the directory using the ls script\n")
        writeFile.write("def write(args):\n")
        writeFile.write("    theList = ls.list()\n")
        writeFile.write("    i = 0\n")
        writeFile.write("    # Find out if there is a file called the same as the input text. If not, create the file using the touch\n")
        writeFile.write("    # script before opening notepad\n")
        writeFile.write("    for j in args:\n")
        writeFile.write("        filename = args[i]\n")
        writeFile.write("        if(any(filename in s for s in theList)):\n")
        writeFile.write("            os.system(\"notepad \" + filename)\n")
        writeFile.write("        else:\n")
        writeFile.write("            giveArgs = [filename]\n")
        writeFile.write("            touch.write(giveArgs)\n")
        writeFile.write("            os.system(\"notepad \" + filename)\n")
        writeFile.write("        i += 1")
        writeFile.close()

        writeFile = open("oschk.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n\n")
        writeFile.write("# This script's job is to double check to make sure that we are indeed running Windows.\n\n")
        writeFile.write("# Import our library\n")
        writeFile.write("import platform, os\n\n")
        writeFile.write("# Main Function\n")
        writeFile.write("def check():\n")
        writeFile.write("    if(platform.system() != \"Windows\"):\n")
        writeFile.write("        print(\"Bash for Windows has seen that you are not using Windows. Launching Bash...\")\n")
        writeFile.write("        os.system(\"bash\")\n")
        writeFile.write("        exit()")
        writeFile.close()

        writeFile = open("popd.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# Popd is the companion command to Pushd, which is a program that allows you\n")
        writeFile.write("# to add directories to a \"stack\", then using it's companion, Popd, allows \n")
        writeFile.write("# you to go to the last directory in that \"stack\". Really useful!\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os, systemvariables, pushd\n\n")
        writeFile.write("# Main Function\n")
        writeFile.write("def go():\n")
        writeFile.write("    # Only do the following if there is something in the directory stack!!!\n")
        writeFile.write("    if(systemvariables.directorystack[0] != \"\"):\n\n")
        writeFile.write("        # Go to the first path listed in the directory stack\n")
        writeFile.write("        os.chdir(systemvariables.directorystack[0])\n\n")
        writeFile.write("        # Remove 1 item from the stack using the pushd program's remove function\n")
        writeFile.write("        pushd.remove(1)\n\n")
        writeFile.write("        # Do the whole generate display thing like we did in the Pushd program\n")
        writeFile.write("        stackDisplay = \"\"\n")
        writeFile.write("        i = 0\n")
        writeFile.write("        while(i <= 7):\n")
        writeFile.write("            stackDisplay = systemvariables.directorystack[i] + \" \" + stackDisplay\n")
        writeFile.write("            i += 1\n")
        writeFile.write("        print(stackDisplay, os.getcwd())\n")
        writeFile.write("    else:\n")
        writeFile.write("        # Directory Stack Empty Error\n")
        writeFile.write("        print(\"bash: popd: directory stack empty\")")
        writeFile.close()

        writeFile = open("pushd.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# Pushd is a program that allows you to add directories to a \"stack\", then\n")
        writeFile.write("# using it's companion, Popd, allows you to go to the last directory in\n")
        writeFile.write("# that \"stack\". Really useful!\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os, systemvariables, cd\n\n")
        writeFile.write("# Function to add a directory to the stack\n")
        writeFile.write("def add(path):\n\n")
        writeFile.write("    # Get ready for a loop\n")
        writeFile.write("    i = 7\n")
        writeFile.write("    while(i > 0):\n\n")
        writeFile.write("        # Take the entry left to the one we are looking at and move\n")
        writeFile.write("        # it to the one we are looking at now\n")
        writeFile.write("        systemvariables.directorystack[i] = systemvariables.directorystack[i-1]\n\n")
        writeFile.write("        # Go to look at the next entry\n")
        writeFile.write("        i -= 1\n\n")
        writeFile.write("    # Now fill in the first entry with the path we inputed\n")
        writeFile.write("    systemvariables.directorystack[0] = path\n\n")
        writeFile.write("# Function to remove an entry from the stack\n")
        writeFile.write("def remove(times):\n\n")
        writeFile.write("    # Commented lines of code are for debugging purposes only.\n")
        writeFile.write("    #print(systemvariables.directorystack)\n\n")
        writeFile.write("    # Counter\n")
        writeFile.write("    j = 0\n\n")
        writeFile.write("    # Loop to do this as many times as requested\n")
        writeFile.write("    while(j != times):\n")
        writeFile.write("        # Another Counter\n")
        writeFile.write("        i = 0\n\n")
        writeFile.write("        # Do this for all items in the stack\n")
        writeFile.write("        while(i < 7):\n")
        writeFile.write("            #print(systemvariables.directorystack)\n\n")
        writeFile.write("            # Move the item we are looking at to the right\n")
        writeFile.write("            systemvariables.directorystack[i] = systemvariables.directorystack[i+1]\n\n")
        writeFile.write("            # Increment\n")
        writeFile.write("            i += 1\n\n")
        writeFile.write("        # Delete the last item\n")
        writeFile.write("        systemvariables.directorystack[7] = \"\"\n\n")
        writeFile.write("        # Increment the counter to prepare to do it again!\n")
        writeFile.write("        j += 1\n\n")
        writeFile.write("# Main Function\n")
        writeFile.write("def go(args):\n")
        writeFile.write("    path = args[0]\n")
        writeFile.write("    # Check to make sure the path exists.\n")
        writeFile.write("    if(os.path.exists(path) == True):\n")
        writeFile.write("        # Add the current directory to the stack using the function we made earlier\n")
        writeFile.write("        add(os.getcwd())\n\n")
        writeFile.write("        # Create a variable to represent the stack for output\n")
        writeFile.write("        stackDisplay = \"\"\n\n")
        writeFile.write("        # Create a counter for the loop that we will program momentarily\n")
        writeFile.write("        i = 0\n\n")
        writeFile.write("        # Do this starting at the beginning of the stack going to the end for\n")
        writeFile.write("        # all the items in the stack\n")
        writeFile.write("        while(i <= 7):\n")
        writeFile.write("            # Add the item we are looking at to the Display variable, insert\n")
        writeFile.write("            # a space, then add on what we already have in the variable\n")
        writeFile.write("            stackDisplay = systemvariables.directorystack[i] + \" \" + stackDisplay\n\n")
        writeFile.write("            # Decrement to shift focus to the item to the right of the stack\n")
        writeFile.write("            i += 1\n\n")
        writeFile.write("        # Finally, display the display we made plus the current directory we\n")
        writeFile.write("        # are in, but only after going to that directory that is first in\n")
        writeFile.write("        # the stack\n")
        writeFile.write("        os.chdir(path)\n")
        writeFile.write("        print(stackDisplay, os.getcwd())\n")
        writeFile.write("    else:\n")
        writeFile.write("        # Directory Not Found Error\n")
        writeFile.write("        print(\"bash: pushd:\", path + \": No such file or directory\")")
        writeFile.close()
        
        writeFile = open("repair.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# Repair is a script that tries to solve any problems that comes up\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os\n")
        writeFile.write("import username\n")
        writeFile.write("import systemvariables, mkdir\n\n")
        writeFile.write("# Repair for anything missing in the base folder\n")
        writeFile.write("# Repair for anything missing in the base of the user folder\n")
        writeFile.write("def baseusrrepair():\n")
        writeFile.write("    # We need to be in this directory, stored as a System Variable we\n")
        writeFile.write("    # set at Startup\n")
        writeFile.write("    os.chdir(systemvariables.settingspath)\n\n")
        writeFile.write("    # If needed, create a new user account\n")
        writeFile.write("    if((os.path.exists(\"Settings/ivhzadgz.bws\") == False) or (os.path.exists(\"Settings/kvnnadgz.bws\") == False)):\n")
        writeFile.write("        username.get()\n\n")
        writeFile.write("    print(\"Solving Problems...\")\n\n")
        writeFile.write("    # Get the username information\n")
        writeFile.write("    username = open(\"Settings/ivhzadgz.bws\")\n\n")
        writeFile.write("    # Put the contents of the username in a variable so we can use\n")
        writeFile.write("    # it any time without having to be in that directory\n")
        writeFile.write("    usrname = username.read()\n\n")
        writeFile.write("    # We don't need the origonal variable anymore\n")
        writeFile.write("    username.close()\n\n")
        writeFile.write("    # Start Recreating Folders\n")
        writeFile.write("    os.chdir(\"..\")\n")
        writeFile.write("    os.mkdir(\"Users\")\n")
        writeFile.write("    os.chdir(\"Users\")\n")
        writeFile.write("    os.mkdir(usrname + \"/\")\n")
        writeFile.write("    os.chdir(usrname)\n")
        writeFile.write("    os.mkdir(\"Documents\")\n")
        writeFile.write("    os.mkdir(\"Downloads\")\n\n")
        writeFile.write("    # Success message and go to the correct directory\n")
        writeFile.write("    print(\"Repair has solved the problem\")\n")
        writeFile.write("    os.chdir(systemvariables.exepath)\n\n")
        writeFile.write("# Like the function we just had, but only repairs in the user's personal folder\n")
        writeFile.write("def baseusrfilerepair():\n")
        writeFile.write("    # We need to be in this directory, stored as a System Variable we\n")
        writeFile.write("    # set at Startup\n")
        writeFile.write("    os.chdir(systemvariables.settingspath)\n\n")
        writeFile.write("    # If needed, create a new user account\n")
        writeFile.write("    if((os.path.exists(\"Settings/ivhzadgz.bws\") == False) or (os.path.exists(\"Settings/kvnnadgz.bws\") == False)):\n")
        writeFile.write("        username.get()\n\n")
        writeFile.write("    print(\"Solving Problems...\")\n\n")
        writeFile.write("    # Get the username information\n")
        writeFile.write("    username = open(\"Settings/ivhzadgz.bws\")\n\n")
        writeFile.write("    # Put the contents of the username in a variable so we can use\n")
        writeFile.write("    # it any time without having to be in that directory\n")
        writeFile.write("    usrname = username.read()\n\n")
        writeFile.write("    # We don't need the origonal variable anymore\n")
        writeFile.write("    username.close()\n\n")
        writeFile.write("    # Start Recreating Folders\n")
        writeFile.write("    os.chdir(\"../Users\")\n")
        writeFile.write("    os.mkdir(usrname + \"/\")\n")
        writeFile.write("    os.chdir(usrname)\n")
        writeFile.write("    os.mkdir(\"Documents\")\n")
        writeFile.write("    os.mkdir(\"Downloads\")\n\n")
        writeFile.write("    # Success message and go to the correct directory\n")
        writeFile.write("    print(\"Repair has solved the problem\")\n")
        writeFile.write("    os.chdir(systemvariables.exepath)\n\n")
        writeFile.write("# Repair for anything missing in the settings folder\n")
        writeFile.write("def settingsrepair():\n")
        writeFile.write("    print(\"Solving Problems...\")\n")
        writeFile.write("    os.chdir(systemvariables.exepath + \"/../..\")\n")
        writeFile.write("    os.mkdir(\"Settings\")\n")
        writeFile.write("    username.get(os.getcwd())\n")
        writeFile.write("    os.chdir(systemvariables.exepath + \"/../..\")\n\n")
        writeFile.write("# Repair the Documents Folder\n")
        writeFile.write("def docs():\n")
        writeFile.write("    print(\"Solving Problems\")\n")
        writeFile.write("    os.chdir(systemvariables.HOME)\n")
        writeFile.write("    mkdir.create([\"Documents\"])\n")
        writeFile.write("    if(os.path.exists(\"Documents\") == True):\n")
        writeFile.write("        print(\"Success! Note: Anything that was in the Documents folder before was deleted.\")\n")
        writeFile.write("        return True\n")
        writeFile.write("    else:\n")
        writeFile.write("        systemvariables.USRDOCS = \"null\"\n")
        writeFile.write("        print(\"Failed. USRDOCS Variable set as null.\")\n")
        writeFile.write("        return False\n")
        writeFile.close()

        writeFile = open("cp.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# cp is a basic script that copies a file\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import filechk\n")
        writeFile.write("import os\n\n")
        writeFile.write("# Main Function. First checks if the file wanted exists\n")
        writeFile.write("def copy(srcfile, dstfile):\n")
        writeFile.write("    if(filechk.check(srcfile) == True):\n")
        writeFile.write("        # Read the file, copy the contents to a new file, then changes the name and/or moves it to new directory\n")
        writeFile.write("        source = open(srcfile, \"r\")\n")
        writeFile.write("        copy = open(srcfile + \" - copy\", \"w\")\n")
        writeFile.write("        copy.write(source.read())\n")
        writeFile.write("        copy.close()\n")
        writeFile.write("        source.close()\n")
        writeFile.write("        copiedfile = srcfile + \" - copy\"\n")
        writeFile.write("        os.rename(copiedfile, dstfile)\n")
        writeFile.write("    else:\n")
        writeFile.write("        print(\"cp: The file\", srcfile, \"does not exist so not copying!\")")
        writeFile.close()

        writeFile = open("pwd.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# pwd is a basic 3-lined script that simply returns the path of the directory we are currently in\n\n")
        writeFile.write("# Our only library\n")
        writeFile.write("import os\n\n")
        writeFile.write("# Main Function\n")
        writeFile.write("def get():\n")
        writeFile.write("    return os.getcwd()")
        writeFile.close()

        writeFile = open("rm.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# rm is a basic script that removes a file\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os\n")
        writeFile.write("import shutil\n")
        writeFile.write("import ls\n")
        writeFile.write("import systemvariables\n\n")
        writeFile.write("# Main Function. First get a listing of the directory from the ls script\n")
        writeFile.write("def remove(args):\n")
        writeFile.write("    # Counters and a list of the directory\n")
        writeFile.write("    directory = ls.list()\n")
        writeFile.write("    i = 0\n")
        writeFile.write("    m = 0\n")
        writeFile.write("    n = 0\n\n")
        writeFile.write("    # Recursive function\n")
        writeFile.write("    if(\"-r\" in args):\n")
        writeFile.write("        # Set the last index to the last index in the array\n")
        writeFile.write("        lastIndex = len(args) - 1\n\n")
        writeFile.write("        # If the first thing in the list of arguments is -r, do the following\n")
        writeFile.write("        if(args[0] == \"-r\"):\n\n")
        writeFile.write("            # Remove the first argument\n")
        writeFile.write("            args.pop(0)\n\n")
        writeFile.write("            # Do this for every item in the arguments array\n")
        writeFile.write("            for j in args:\n\n")
        writeFile.write("                # Set this variable to the current item in the args array\n")
        writeFile.write("                file = args[i]\n\n")
        writeFile.write("                # Do this for every file in the directory\n")
        writeFile.write("                if(any(file in s for s in directory)):\n")
        writeFile.write("                    # Make sure it's a directory\n")
        writeFile.write("                    if(os.path.isdir(file) == True):\n")
        writeFile.write("                        # Protection for the Documents folder, which could break the program\n")
        writeFile.write("                        if(os.getcwd() == systemvariables.HOME):\n")
        writeFile.write("                            if(file == \"Documents\"):\n")
        writeFile.write("                                force = input(\"rm: remove write-protected directory '\" + file + \"'? \")\n")
        writeFile.write("                                if((force == \"y\") or (force == \"Y\")):\n")
        writeFile.write("                                    shutil.rmtree(file)\n")
        writeFile.write("                            # If the directory mentioned isn't the documents directory, remove the directory\n")
        writeFile.write("                            # no problem\n")
        writeFile.write("                            else:\n")
        writeFile.write("                                shutil.rmtree(file)\n")
        writeFile.write("                        # If the current directory isn't the home directory, remove the directory no problem\n")
        writeFile.write("                        else:\n")
        writeFile.write("                            shutil.rmtree(file)\n")
        writeFile.write("                    # If it isn't a directory, just delete the file\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        os.remove(file)\n")
        writeFile.write("                # Error Message\n")
        writeFile.write("                else:\n")
        writeFile.write("                    print(\"rm: cannot remove '\" + file + \": No such file or directory\")\n\n")
        writeFile.write("                # Increment our counter\n")
        writeFile.write("                i += 1\n")
        writeFile.write("        # If the last arguemnt is -r, do the following\n")
        writeFile.write("        elif(args[lastIndex] == \"-r\"):\n\n")
        writeFile.write("            # Remove the last argument from the array\n")
        writeFile.write("            args.pop(lastIndex)\n\n")
        writeFile.write("            # For everything in the arguments array:\n")
        writeFile.write("            for j in args:\n")
        writeFile.write("                file = args[i]\n")
        writeFile.write("                if(any(file in s for s in directory)):\n")
        writeFile.write("                    # Make sure it isn't a directory\n")
        writeFile.write("                    if(os.path.isdir(file) == True):\n")
        writeFile.write("                        shutil.rmtree(file)\n")
        writeFile.write("                    else:\n")
        writeFile.write("                        os.remove(file)\n")
        writeFile.write("                else:\n")
        writeFile.write("                    print(\"rm: cannot remove '\" + file + \": No such file or directory\")\n")
        writeFile.write("                i += 1\n")
        writeFile.write("    else:\n")
        writeFile.write("        for j in args:\n")
        writeFile.write("            file = args[i]\n")
        writeFile.write("            # If it exists, remove it. If not, display a message\n")
        writeFile.write("            if(any(file in s for s in directory)):\n")
        writeFile.write("                # Make sure it isn't a directory\n")
        writeFile.write("                if(os.path.isfile(file) == True):\n")
        writeFile.write("                    os.remove(file)\n")
        writeFile.write("                else:\n")
        writeFile.write("                    print(\"rm: cannot remove '\" + file + \": Is a directory\")\n")
        writeFile.write("            else:\n")
        writeFile.write("                print(\"rm: cannot remove '\" + file + \": No such file or directory\")\n")
        writeFile.write("            i += 1")
        writeFile.close()

        writeFile = open("Startup.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# Startup is the file that starts off Bash For Windows. You can only run Bash for Windows with this script.\n\n")
        writeFile.write("# Import libraries\n")
        writeFile.write("import platform\n")
        writeFile.write("import os\n")
        writeFile.write("# If we are not in the right place, get us to the right place\n")
        writeFile.write("if(os.path.exists(os.getcwd() + \"/../Include\") == False):\n")
        writeFile.write("    os.chdir(\"Bash/Bash/Source/Include\")\n")
        writeFile.write("import bash\n")
        writeFile.write("import os.path\n")
        writeFile.write("import username\n")
        writeFile.write("import usrmgr\n")
        writeFile.write("import usrmgr2\n")
        writeFile.write("import repair\n")
        writeFile.write("import systemvariables\n")
        writeFile.write("import time\n\n")
        writeFile.write("# The commented out lines are for me to use for debugging purposes only.\n")
        writeFile.write("#print(os.getcwd())\n")
        writeFile.write("#print(os.path.dirname(os.path.realpath(__file__)))\n\n")
        writeFile.write("# Set a system variable\n")
        writeFile.write("systemvariables.exepath = os.getcwd()\n")
        writeFile.write("systemvariables.settingspath = systemvariables.exepath + \"/../..\"\n\n")
        writeFile.write("# Check to make sure we are running on Windows and if not start bash\n")
        writeFile.write("if(platform.system() != \"Windows\"):\n")
        writeFile.write("    print(\"Bash for Windows has seen that you are not using Windows. Launching Bash...\")\n")
        writeFile.write("    os.system(\"bash\")\n")
        writeFile.write("    exit()\n\n")
        writeFile.write("# Move to the root of the file structure\n")
        writeFile.write("os.chdir(systemvariables.exepath + \"/../..\")\n")
        writeFile.write("#print(os.getcwd())\n\n")
        writeFile.write("os.chdir(\"../..\")\n")
        writeFile.write("#print(os.getcwd())\n\n")
        writeFile.write("usrname = open(\"Bash/Bash/Settings/ivhzadgz.bws\")\n\n")
        writeFile.write("# See if any folders are deleted and if they are attempt to fix it using the repair script\n")
        writeFile.write("if(os.path.exists(\"Bash/Users\") == False):\n")
        writeFile.write("    choice = input(\"Unfortunatly, Bash for Windows could not find your data. Do you want to try to fix this with Bash for Windows Repair? [y, N] # \")\n")
        writeFile.write("    if((choice == \"y\") or (choice == \"Y\")):\n")
        writeFile.write("        repair.baseusrrepair()\n")
        writeFile.write("    else:\n")
        writeFile.write("        print(\"Abort.\")\n\n")
        writeFile.write("# Go back to here so that we don't trigger an unneeded repair\n")
        writeFile.write("os.chdir(systemvariables.settingspath + \"/../..\")\n\n")
        writeFile.write("# Check if the user folder was deleted\n")
        writeFile.write("if(os.path.exists(\"Bash/Users/\" + usrname.read()) == False):\n")
        writeFile.write("    choice = input(\"Unfortunatly, Bash for Windows could not find your data. Do you want to try to fix this with Bash for Windows Repair? [y, N] # \")\n")
        writeFile.write("    if((choice == \"y\") or (choice == \"Y\")):\n")
        writeFile.write("        repair.baseusrfilerepair()\n")
        writeFile.write("    else:\n")
        writeFile.write("        print(\"Abort.\")\n\n")
        writeFile.write("# We don't need this file to stay open\n")
        writeFile.write("usrname.close()\n\n")
        writeFile.write("# Go back to here so that we don't trigger an unneeded repair\n")
        writeFile.write("os.chdir(systemvariables.settingspath + \"/../..\")\n\n")
        writeFile.write("# Tell the login prompt what folder we are in\n")
        writeFile.write("usrmgr2.usrcheck(os.getcwd())\n")
        writeFile.write("username = open(\"Bash/Bash/Settings/ivhzadgz.bws\" , \"r\")\n\n")
        writeFile.write("# Call the login prompt\n")
        writeFile.write("usrmgr.logon()")
        writeFile.close()

        writeFile = open("systemvariables.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# systemvariables holds all variables open to all parts of the system who import them. The variables can be set, modified,\n")
        writeFile.write("# and read depending on what a script may need to do with them. The end user may only see what are in the variables through\n")
        writeFile.write("# means of the lsvars and echo commands.\n\n")
        writeFile.write("usrsession = \"\"\n")
        writeFile.write("HOME = \"\"\n")
        writeFile.write("ROOT = \"\"\n")
        writeFile.write("exepath = \"\"\n")
        writeFile.write("USRDOCS = \"\"\n")
        writeFile.write("settingspath = \"\"\n")
        writeFile.write("loginfopath = \"\"\n")
        writeFile.write("srcpath = \"\"\n")
        writeFile.write("usrpath = \"\"\n")
        writeFile.write("bshpath = \"\"\n")
        writeFile.write("lastdir = \"\"\n")
        writeFile.write("directorystack = [\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]")
        writeFile.close()

        writeFile = open("touch.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# touch is a script that creates a new empty file\n\n")
        writeFile.write("# Our only library\n")
        writeFile.write("import os\n\n")
        writeFile.write("# Main function\n")
        writeFile.write("def write(args):\n")
        writeFile.write("    i = 0\n")
        writeFile.write("    for j in args:\n")
        writeFile.write("        filename = args[i]\n")
        writeFile.write("        new = open(filename, \"w\")\n")
        writeFile.write("        new.write("")\n")
        writeFile.write("        new.close()")
        writeFile.close()

        writeFile = open("username.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# username sets the username and password\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os\n")
        writeFile.write("import systemvariables\n\n")
        writeFile.write("# Main Function\n")
        writeFile.write("def get():\n")
        writeFile.write("    os.chdir(systemvariables.settingspath)\n")
        writeFile.write("    username = input(\"What do you want your user name to be? # \")\n")
        writeFile.write("    namefile = open(\"Settings/ivhzadgz.bws\", \"w\")\n")
        writeFile.write("    namefile.write(username)\n")
        writeFile.write("    namefile.close\n")
        writeFile.write("    password = input(\"What Password?                         # \")\n")
        writeFile.write("    passfile = open(\"Settings/kvnnadgz.bws\", \"w\")\n")
        writeFile.write("    passfile.write(password)\n")
        writeFile.write("    passfile.close")
        writeFile.close()

        writeFile = open("usrmgr.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# usrmgr is a script responsable for the login prompt, the not-yet implemented multiple user function and\n")
        writeFile.write("# welcoming the user into Bash For Windows. Despite not being the first script executed, this is the first\n")
        writeFile.write("# time the user interacts with Bash For Windows.\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os\n")
        writeFile.write("import repair\n")
        writeFile.write("import bash, platform\n")
        writeFile.write("import systemvariables, oschk\n\n")
        writeFile.write("# Clear the screen to get rid of the messages from the imported libraries\n")
        writeFile.write("os.system(\"cls\")\n\n")
        writeFile.write("# Login Prompt\n")
        writeFile.write("def logon():\n")
        writeFile.write("    # Check again to make sure we are running Windows\n")
        writeFile.write("    oschk.check()\n\n")
        writeFile.write("    os.chdir(systemvariables.exepath)\n")
        writeFile.write("    os.chdir(\"../../\")\n")
        writeFile.write("    incorrect = True\n")
        writeFile.write("    while(incorrect == True):\n")
        writeFile.write("        user = open(\"Settings/ivhzadgz.bws\", \"r\")\n")
        writeFile.write("        userguess = input(\"Type a user name # \")\n")
        writeFile.write("        if(userguess == user.read()):\n")
        writeFile.write("           incorrect = False\n")
        writeFile.write("        else:\n")
        writeFile.write("           print(\"Incorrect Username.\")\n")
        writeFile.write("    incorrect = True\n\n")
        writeFile.write("    # Check double check to make sure we are running Windows\n")
        writeFile.write("    if(platform.system() != \"Windows\"):\n")
        writeFile.write("        print(\"Bash for Windows has seen that you are not using Windows. Launching Bash...\")\n")
        writeFile.write("        os.system(\"bash\")\n")
        writeFile.write("        exit()\n\n")
        writeFile.write("    while(incorrect == True):\n")
        writeFile.write("        password = open(\"Settings/kvnnadgz.bws\", \"r\")\n")
        writeFile.write("        passguess = input(\"password # \")\n")
        writeFile.write("        if(passguess == password.read()):\n")
        writeFile.write("            incorrect = False\n")
        writeFile.write("            systemvariables.usrsession = userguess\n")
        writeFile.write("        else:\n")
        writeFile.write("            print(\"Incorrect Password.\")\n")
        writeFile.write("    password.close()\n")
        writeFile.write("    print(\"Welcome to Bash(the Bourne Again Shell) for Windows!\")\n")
        writeFile.write("    user.close()\n")
        writeFile.write("    bash.run()\n\n")
        writeFile.write("# Function for checking a password based on username provided\n")
        writeFile.write("def checkpassword():\n")
        writeFile.write("    session = systemvariables.usrsession\n")
        writeFile.write("    user = \"\"\n")
        writeFile.write("    incorrect = True\n")
        writeFile.write("    if(os.path.exists(\"Settings/ivhzadgzzoneth.bws\") == True):\n")
        writeFile.write("        potentialusr1 = open(\"Settings/ivhzadgzzoneth.bws\" + \"r\")\n")
        writeFile.write("        if(session == potentialusr1.read()):\n")
        writeFile.write("            user = \"Settings/ivhzadgzzoneth.bws\"\n")
        writeFile.write("    potentialusr2 = open(\"Settings/ivhzadgz.bws\", \"r\")\n")
        writeFile.write("    if(session == potentialusr2.read()):\n")
        writeFile.write("        user = \"Settings/ivhzadgzzoneth.bws\"\n")
        writeFile.write("    else:\n")
        writeFile.write("        user = \"No User\"\n")
        writeFile.write("    if(user != \"No User\"):\n")
        writeFile.write("        if(user == \"Settings/ivhzadgzzoneth.bws\"):\n")
        writeFile.write("            while(incorrect == True):\n")
        writeFile.write("                password = open(\"Settings/kvnnadgzzoneth.bws\", \"r\")\n")
        writeFile.write("                passguess = input(\"password # \")\n")
        writeFile.write("                if(passguess == password.read()):\n")
        writeFile.write("                    incorrect = False\n")
        writeFile.write("                else:\n")
        writeFile.write("                   print(\"Incorrect Password.\")\n")
        writeFile.write("        else:\n")
        writeFile.write("            while(incorrect == True):\n")
        writeFile.write("                password = open(\"Settings/kvnnadgz.bws\", \"r\")\n")
        writeFile.write("                passguess = input(\"password # \")\n")
        writeFile.write("                if(passguess == password.read()):\n")
        writeFile.write("                    incorrect = False\n")
        writeFile.write("                else:\n")
        writeFile.write("                    print(\"Incorrect Password.\")\n")
        writeFile.write("    else:\n")
        writeFile.write("        logon()")
        writeFile.close()

        writeFile = open("usrmgr2.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
        writeFile.write("'''\n")
        writeFile.write("# usrmgr2 checks for a needed repair in the user folders\n\n")
        writeFile.write("# Libraries\n")
        writeFile.write("import os\n")
        writeFile.write("import repair\n")
        writeFile.write("import bash\n")
        writeFile.write("import usrmgr\n\n")
        writeFile.write("# Main function\n")
        writeFile.write("def usrcheck(path):\n")
        writeFile.write("    if(os.path.exists(\"Bash/Bash/Settings\") == False):\n")
        writeFile.write("        choice = input(\"Unfortunatly, Bash for Windows could not find settings. Do you want to try to fix this with Bash for Windows Repair? [y, N] # \")\n")
        writeFile.write("        if((choice == \"y\") or (choice == \"Y\")):\n")
        writeFile.write("            repair.settingsrepair()\n")
        writeFile.write("        else:\n")
        writeFile.write("            print(\"Abort.\")\n")
        writeFile.write("    elif((os.path.exists(\"Bash/Bash/Settings/ivhzadgz.bws\") == False) or (os.path.exists(\"Bash/Bash/Settings/kvnnadgz.bws\") == False)):\n")
        writeFile.write("        choice = input(\"Unfortunatly, Bash for Windows could not find user settings. Do you want to try to fix this with Bash for Windows Repair? [y, N] # \")\n")
        writeFile.write("        if((choice == \"y\") or (choice == \"Y\")):\n")
        writeFile.write("            repair.usersettingsrepair()\n")
        writeFile.write("        else:\n")
        writeFile.write("            print(\"Abort.\")\n")
        writeFile.write("            logon()\n")
        writeFile.write("    else:\n")
        writeFile.write("        usrmgr.logon()")
        writeFile.close()

        writeFile = open("tofile.py", "w")
        writeFile.write("'''\n")
        writeFile.write("This file is under the MIT License.\n\n")
        writeFile.write("Copyright 2019-2020 <NAME>\n\n")
        writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
        writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
        writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
        writeFile.write("subject to the following conditions:\n\n")
        writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
        writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
        writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
        writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
        writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n")
        writeFile.write("'''\n")
        writeFile.write("def write(type, contents, filename):\n")
        writeFile.write("    # If told to append, append given text to file.\n")
        writeFile.write("    if(type == \">>\"):\n")
        writeFile.write("        giveTouch = [contents]\n")
        writeFile.write("        file = open(filename, \"a\")\n")
        writeFile.write("        file.write(\"\\n\" + contents)\n")
        writeFile.write("        file.close()\n\n\n")
        writeFile.write("    # If told to overwrite, overwrite a file and put given text in file.\n")
        writeFile.write("    elif(type == \">\"):\n")
        writeFile.write("        giveTouch = [filename]\n")
        writeFile.write("        fileWrite = open(filename, \"w\")\n")
        writeFile.write("        fileWrite.write(contents)\n")
        writeFile.write("        fileWrite.close()")
    print("Creating User Account...")
    os.chdir(path)
    os.chdir("Bash/Bash/Settings")
    nonam = True
    while(nonam == True):
        username = input("What do you want your user name to be? # ")
        namefile = open("ivhzadgz.bws", "w")
        if(" " in username):
            i = 0
            for j in username:
                if(j == " "):
                    username = username[0 : i : ] + username[i + 1: : ]
                    break
                i += 1
            print("The username cannot have a space. Your username has been changed to", username)
        if(username != ""):
            nonam = False
            break
        print("You must have a username. Try again.")
    namefile.write(username)
    namefile.close()
    password = input("What Password?                         # ")
    passfile = open("<PASSWORD>", "w")
    passfile.write(password)
    passfile.close()
    os.chdir("../../Users")
    os.mkdir(username)
    os.chdir(username)
    os.mkdir("Documents")
    os.mkdir("Downloads")
    if(normalInstall == True):
        os.chdir("Documents")
        writeFile = open("Modify_Code_Notes.txt", "w")
        writeFile.write("You have chosen a normal install, which includes all the code for you to modify.\n")
        writeFile.write("If you want to look at and/or modify the code, you may want to know how it works to\n")
        writeFile.write("more easily modify it. If you don't want to modify anything, you can simply delete this\n")
        writeFile.write("file.\n\n\n\n")
        writeFile.write("Here is a visual of how the user goes through the code including all files executed:\n")
        writeFile.write("execute: Startup.py\n")
        writeFile.write("             |\n")
        writeFile.write("             +---- Check if we are running Windows\n")
        writeFile.write("             |                    |\n")
        writeFile.write("             |     Check to see if the file system is intact and if so, repair it\n")
        writeFile.write("             |                    |\n")
        writeFile.write("             |                    +---- repair.py\n")
        writeFile.write("          usrmgr.py\n")
        writeFile.write("             |\n")
        writeFile.write("             +---- Load Username and Password into memory\n")
        writeFile.write("             |                    |\n")
        writeFile.write("             |     Ask for Username and check if it matches the username in memory\n")
        writeFile.write("             |                    |                           ^\n")
        writeFile.write("             |                    +---- Is it correcct?       |\n")
        writeFile.write("             |                    |            |              |\n")
        writeFile.write("             |                    |           Yes?            |\n")
        writeFile.write("             |                    |            |              |\n")
        writeFile.write("             |                    |<-----------+              |\n")
        writeFile.write("             |                    |            |              |\n")
        writeFile.write("             |                    |           No?             |\n")
        writeFile.write("             |                    |            |              |\n")
        writeFile.write("             |                    |            +--------------+\n")
        writeFile.write("             |                    |\n")
        writeFile.write("             |     Ask for Password and check if it matches the password in memory\n")
        writeFile.write("             |                    |                           ^\n")
        writeFile.write("             |                    +---- Is it correcct?       |\n")
        writeFile.write("             |                    |            |              |\n")
        writeFile.write("             |                    |           Yes?            |\n")
        writeFile.write("             |                    |            |              |\n")
        writeFile.write("             |                    |<-----------+              |\n")
        writeFile.write("             |                    |            |              |\n")
        writeFile.write("             |                    |           No?             |\n")
        writeFile.write("             |                    |            |              |\n")
        writeFile.write("             |                    |            +--------------+\n")
        writeFile.write("             |                    |\n")
        writeFile.write("             |             Display Welcome\n")
        writeFile.write("             |\n")
        writeFile.write("          bash.py\n")
        writeFile.write("             |\n")
        writeFile.write("             +---- Set some enviornment variables\n")
        writeFile.write("                                  |\n")
        writeFile.write("                                  +---- systemvariables.py\n")
        writeFile.write("                                  |\n")
        writeFile.write("                                  |<-------------------------+\n")
        writeFile.write("                                  |                          |\n")
        writeFile.write("                   Input Command and any arguments           |\n")
        writeFile.write("                                  |                          |\n")
        writeFile.write("                   Seperate Command from Arguments           |\n")
        writeFile.write("                                  |                          |\n")
        writeFile.write("                   Check command entered and check it against|list of commands\n")
        writeFile.write("                                  |                          |\n")
        writeFile.write("                                  +---- *.py                 |\n")
        writeFile.write("                                  |                          |\n")
        writeFile.write("                   Does the command match list of commands?  |\n")
        writeFile.write("                                  |                          |\n")
        writeFile.write("                                  +---- No?                  |\n")
        writeFile.write("                                         |                   |\n")
        writeFile.write("                               Display error message         |\n")
        writeFile.write("                                         |                   |\n")
        writeFile.write("                                         +-------------------+")
        writeFile.close()
        os.chdir("..")
    print("Finalizing Installation...")
    os.chdir(path)
    os.mkdir("Temporary Install Files")
    os.chdir("Temporary Install Files")
    tmpInsFil = os.getcwd()
    writeFile = open("shortcut.bat", "w")
    writeFile.write("@echo off\n")
    writeFile.write("echo Set oWS = WScript.CreateObject(\"WScript.Shell\") > CreateShortcut.vbs\n")
    writeFile.write("echo sLinkFile = \"" + path + "\\Startup.lnk\" >> CreateShortcut.vbs\n")
    writeFile.write("echo Set oLink = oWS.CreateShortcut(sLinkFile) >> CreateShortcut.vbs\n")
    writeFile.write("echo oLink.TargetPath = \"" + includeDir + "\\Startup.exe\" >> CreateShortcut.vbs\n")
    writeFile.write("echo oLink.Save >> CreateShortcut.vbs\n")
    writeFile.write("cscript CreateShortcut.vbs\n")
    writeFile.write("del CreateShortcut.vbs\n")
    writeFile.close()
    os.system("shortcut.bat > lnkout")
    os.chdir("..")
    writeFile = open("Readme.txt", "w")
    writeFile.write("==============================================\n")
    writeFile.write("   Bash for Windows: The Bourne Again SHell   \n")
    writeFile.write("==============================================\n")
    writeFile.write(" Welcome to Bash for Windows! First off:      \n")
    writeFile.write(" there isn't really any type of help          \n")
    writeFile.write(" document in Bash for Windows. Bash for       \n")
    writeFile.write(" Windows tries to work as much like the real  \n")
    writeFile.write(" Bash as possible, and as far as I can tell,  \n")
    writeFile.write(" there isn't any sort of help document in     \n")
    writeFile.write(" Bash that tells you commands. The closest    \n")
    writeFile.write(" thing there is to a help document is the man \n")
    writeFile.write(" page, which hasn't been implemented yet. If  \n")
    writeFile.write(" you want to learn Bash, Google is your       \n")
    writeFile.write(" friend.                                      \n")
    writeFile.write("==============================================\n")
    writeFile.write(" Bash for Windows is not exactly like Bash.   \n")
    writeFile.write(" It has taken many hours of my free time to   \n")
    writeFile.write(" get it to where it is as of version 1.0.     \n")
    writeFile.write(" This being said, there are a few things that \n")
    writeFile.write(" work in Bash that don't work in Bash for     \n")
    writeFile.write(" Windows. A few of them are:                  \n")
    writeFile.write("  - \\ then space doesn't put in a space      \n")
    writeFile.write("    - Spaces are exclusivly used to seperate  \n")
    writeFile.write("      the command to an argument to another   \n")
    writeFile.write("      argument.                               \n")
    writeFile.write("  - Bash Scripting doesn't work at all        \n")
    writeFile.write("    - You can't really run any program that is\n")
    writeFile.write("      not in Bash for Windows. You would have \n")
    writeFile.write("      to go back to the command prompt or     \n")
    writeFile.write("      PowerShell                              \n")
    writeFile.write("  - Sudo doesn't execute things as            \n")
    writeFile.write("    Administrator                             \n")
    writeFile.write("    - Would need to learn how to elevate      \n")
    writeFile.write("      permissions in Python                   \n")
    writeFile.write("  - No such thing as Apt, Dnf, Pacman, etc.   \n")
    writeFile.write("    - Tried this. Couldn't figure out how to  \n")
    writeFile.write("      download a file from the internet in a  \n")
    writeFile.write("       new Windows install (Without 3rd Party \n")
    writeFile.write("       program having to be installed first)  \n")
    writeFile.write("  - Cannot pipe the output of a command into  \n")
    writeFile.write("    another file                              \n")
    writeFile.write("  - Many command cannot send output into a    \n")
    writeFile.write("    a file using > or >>                      \n")
    writeFile.write("    - The cat command does this, no other     \n")
    writeFile.write("      command does.                           \n")
    writeFile.write("  - No way to create or alter variables from  \n")
    writeFile.write("    the prompt                                \n")
    writeFile.write("    - You can view all of the systemvariables \n")
    writeFile.write("      from the code, but that is the extent   \n")
    writeFile.write("      of what you can do.                     \n")
    writeFile.write("  - Many other commands in Bash don't work in \n")
    writeFile.write("    Bash for Windows                          \n")
    writeFile.write("==============================================\n")
    writeFile.write(" Bash for Windows's code is avalible on       \n")
    writeFile.write(" GitHub! Either run uname -g from the prompt  \n")
    writeFile.write(" or go to https://bit.ly/2KPHRmu to look at   \n")
    writeFile.write(" the code behind Bash for Windows!            \n")
    writeFile.write("==============================================")
    writeFile.close()
    os.system("copy Readme.txt Bash\\Users\\" + username + "\\Documents\\Readme.txt")
    shutil.rmtree("Temporary Install Files")
    os.system("cls")
    print("Bash for Windows Setup is Complete! To start Bash for Windows,\nExecute the Startup executable,\
 both in the base folder that you installed\nBash for Windows into and in Bash/Bash/Source/Include.\n")
    input("Press Enter to Exit...")
except KeyboardInterrupt:
    os.system("cls")
    print("Bash for Windows Setup Wizard was canceled. Thanks for your intrest! Goodbye!")
    time.sleep(3)
    exit()
This file is under the MIT License.
 
 Copyright 2019-2020 <NAME>
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files 
 (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, 
 publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 
 subject to the following conditions:
 
 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 
 FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 
 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # This is the install script. # Libraries # First, let's make sure we are running Windows. This install script doesn't work on anything else. # Give the user a chance to read the message, then exit \n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files\n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" # Check once again to make sure we are running Windows\n") # Get user name\n") # Get back to \"Home\" folder\n") # Reset the lastdir variable\n") # Do this until told to exit\n") # Change display depending on where the user is in the file system\n") # Prompt\n") # Find a space. If one is found, put it in another variable.\n") # Counters\n") # Only do it if there is indeed a space\n") # Only do this after a space\n") # If we come across a space, add an item to the array of arguments and skip the rest\n") # Take the current item in the args array and put in each character of the input\n") # string, then delete that same character from the input string\n") # Reset the counters\n") # If we have at least 1 space, make sure you take out the last character\n") # in the command variable that happens to be a space\n") # Run the command. If it dosen't exist, display a message\n") # \")\n") # \")\n") \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" # Make sure the requested file exists and is indeed a file and not a folder.\n") # If told to do so, either append or overwrite a file where we send all output to\n") # If not told to send output to a file, print to screen.\n") \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" # If we have inputed something special, go to a special place.\n") # If not, go to where directed.\n") # Set the lastdir system variable\n") \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" # See if the first character of a string is a dollar sign, the symbol that declares the want of a\n") # system variable\n") # If there is a dollar sign, find out what variable we want and print it out. If not, print out\n") # inputted text\n\n") # If not told to send endstring to a file, print to screen.\n") \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" # Store all output in a variable\n") # If we don't request to list the current directory and don't want to send output of current\n") # directory to file, do the following:\n") # Make sure the directory requested exists and that it is a directory\n") # Remember what directory we are currently in then change to the requested directory.\n") # Get a listing fo what is in the directory, then list them in a fancy way\n") # Go to the directory we were just in.\n") # If asked to do so, send output to a file. Either overwrite a file or append to it.\n") # If we don't want to send output of command to a file, print the output to the screen.\n") # Error Message: if it is a file repeat file name\n") # Either print listing of current directory or send output of command to file.\n") # Pretty much the same as before.\n") #print(os.path.isdir(str(dir_list[i])))\n") \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" # If we recieved -p in an argument, do the following:\n") # Figure out where the -p argument is so that we can find what path it is talking about\n") # Reset and create some counters\n") # Array of directories\n") # Add all the directories we need to go into or create to that array\n") # Reset our counters, we'll need them again.\n") # Remember what directory we are in right now\n") # Go and create the directories stored in that array\n") # Go back to our initial directory\n") # Simply make the directories provided\n") \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" # Create some counters\n") # If we have a /, we need to move the file into a directory\n") # Figure out what directories we need to go through for the destination\n") # Make sure the path exists\n") # If we are told to move it into a directory, make sure it is a directory\n") # Error message, or rename the file\n") # Error message\n") \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" # Find out if there is a file called the same as the input text. If not, create the file using the touch\n") # script before opening notepad\n") \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" # Only do the following if there is something in the directory stack!!!\n") # Go to the first path listed in the directory stack\n") # Remove 1 item from the stack using the pushd program's remove function\n") # Do the whole generate display thing like we did in the Pushd program\n") # Directory Stack Empty Error\n") \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" # Get ready for a loop\n") # Take the entry left to the one we are looking at and move\n") # it to the one we are looking at now\n") # Go to look at the next entry\n") # Now fill in the first entry with the path we inputed\n") # Commented lines of code are for debugging purposes only.\n") #print(systemvariables.directorystack)\n\n") # Counter\n") # Loop to do this as many times as requested\n") # Another Counter\n") # Do this for all items in the stack\n") #print(systemvariables.directorystack)\n\n") # Move the item we are looking at to the right\n") # Increment\n") # Delete the last item\n") # Increment the counter to prepare to do it again!\n") # Check to make sure the path exists.\n") # Add the current directory to the stack using the function we made earlier\n") # Create a variable to represent the stack for output\n") # Create a counter for the loop that we will program momentarily\n") # Do this starting at the beginning of the stack going to the end for\n") # all the items in the stack\n") # Add the item we are looking at to the Display variable, insert\n") # a space, then add on what we already have in the variable\n") # Decrement to shift focus to the item to the right of the stack\n") # Finally, display the display we made plus the current directory we\n") # are in, but only after going to that directory that is first in\n") # the stack\n") # Directory Not Found Error\n") \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" # We need to be in this directory, stored as a System Variable we\n") # set at Startup\n") # If needed, create a new user account\n") # Get the username information\n") # Put the contents of the username in a variable so we can use\n") # it any time without having to be in that directory\n") # We don't need the origonal variable anymore\n") # Start Recreating Folders\n") # Success message and go to the correct directory\n") # We need to be in this directory, stored as a System Variable we\n") # set at Startup\n") # If needed, create a new user account\n") # Get the username information\n") # Put the contents of the username in a variable so we can use\n") # it any time without having to be in that directory\n") # We don't need the origonal variable anymore\n") # Start Recreating Folders\n") # Success message and go to the correct directory\n") \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" # Read the file, copy the contents to a new file, then changes the name and/or moves it to new directory\n") \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" # Counters and a list of the directory\n") # Recursive function\n") # Set the last index to the last index in the array\n") # If the first thing in the list of arguments is -r, do the following\n") # Remove the first argument\n") # Do this for every item in the arguments array\n") # Set this variable to the current item in the args array\n") # Do this for every file in the directory\n") # Make sure it's a directory\n") # Protection for the Documents folder, which could break the program\n") # If the directory mentioned isn't the documents directory, remove the directory\n") # no problem\n") # If the current directory isn't the home directory, remove the directory no problem\n") # If it isn't a directory, just delete the file\n") # Error Message\n") # Increment our counter\n") # If the last arguemnt is -r, do the following\n") # Remove the last argument from the array\n") # For everything in the arguments array:\n") # Make sure it isn't a directory\n") # If it exists, remove it. If not, display a message\n") # Make sure it isn't a directory\n") \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" # \")\n") # \")\n") \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" # \")\n") # \")\n") \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" # Check again to make sure we are running Windows\n") # \")\n") # Check double check to make sure we are running Windows\n") # \")\n") # \")\n") # \")\n") \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n")
         writeFile.write(" # \")\n") # \")\n") \n")
         writeFile.write("This file is under the MIT License.\n\n")
         writeFile.write("Copyright 2019-2020 <NAME>\n\n")
         writeFile.write("Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \n")
         writeFile.write("(the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, \n")
         writeFile.write("publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n")
         writeFile.write("subject to the following conditions:\n\n")
         writeFile.write("The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n")
         writeFile.write("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n")
         writeFile.write("MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \n")
         writeFile.write("FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \n")
         writeFile.write("WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n")
         writeFile.write(" # If told to append, append given text to file.\n") # If told to overwrite, overwrite a file and put given text in file.\n") # ") # ")