Batch file running differently
Posted: 22 Jul 2012 20:30
ok, lately my code has been acting weird. When run like normal, It works perfectly. When run by another batch file how ever, several errors occur.
Here's the code (Don't get overwhelmed)
Here's the code (Don't get overwhelmed)
Code: Select all
@echo off
color 47
IF EXIST F:/Security/Security.notl GOTO security
cd F:/DATA
title Notelek Assist
:test
:start
cls
echo Welcome Back %username%!
echo 8888888888888888888888888888888888888888888888888888888888
echo 8 Beta 0.0.6 8
echo 8 888b 888 888 888 888 8
echo 8 8888b 888 888 888 888 8
echo 8 88888b 888 888 888 888 8
echo 8 888Y88b 888 .d88b. 888888 .d88b. 888 .d88b. 888 888 8
echo 8 888 Y88b888d88""88b888 d8P Y8b888d8P Y8b888 .88P 8
echo 8 888 Y88888888 888888 8888888888888888888888888K 8
echo 8 888 Y8888Y88..88PY88b. Y8b. 888Y8b. 888 "88b 8
echo 8 888 Y888 "Y88P" "Y888 "Y8888 888 "Y8888 888 888 8
echo 8 8
echo 8 d8888 d8b 888 8
echo 8 d88888 Y8P 888 8
echo 8 d88P888 888 8
echo 8 d88P 888.d8888b .d8888b 888.d8888b 888888 8
echo 8 d88P 88888K 88K 88888K 888 8
echo 8 d88P 888"Y8888b."Y8888b.888"Y8888b.888 8
echo 8 d8888888888 X88 X88888 X88Y88b. 8
echo 8 d88P 888 88888P' 88888P'888 88888P' "Y888 8
echo 8 8
echo 8 8
echo 8 What would you like to do? 8
echo 8888888888888888888888888888888888888888888888888888888888
set /p m=
if "%m%"=="asdf" GOTO invalid
if "%m%"=="reboot" GOTO reboot
if "%m%"=="exit" exit
if "%m%"=="credits" GOTO credits
if "%m%"=="mute" GOTO mute
if "%m%"=="unmute" GOTO unmute
if "%m%"=="open cd drive" GOTO drive
if "%m%"=="term" GOTO term
if "%m%"=="screenshot" GOTO screenshot
if "%m%"=="color" GOTO color
if "%m%"=="teamview" GOTO team
if "%m%"=="help" GOTO help
if "%m%"=="edit" GOTO edit
if "%m%"=="calc" GOTO calc
if "%m%"=="search" GOTO search
if "%m%"=="mcs" GOTO ms
if "%m%"=="mcc" GOTO mc
if "%m%"=="cmd" GOTO 1
if "%m%"=="speak" GOTO speak
if "%m%"=="docs" GOTO docs
:invalid
cls
echo The command you entered is not in the system
pause
GOTO start
:speak
cls
echo What should I say?
set /p sp=
cls
echo Speaking...
nircmd.exe speak text %sp%
echo Done!
GOTO start
:1
cls
GOTO start2
:start5
cls
%com%
pause
:start2
echo Welcome Back %username%!
echo 8888888888888888888888888888888888888888888888888888888888
echo 8 Beta 0.0.6 8
echo 8 888b 888 888 888 888 8
echo 8 8888b 888 888 888 888 8
echo 8 88888b 888 888 888 888 8
echo 8 888Y88b 888 .d88b. 888888 .d88b. 888 .d88b. 888 888 8
echo 8 888 Y88b888d88""88b888 d8P Y8b888d8P Y8b888 .88P 8
echo 8 888 Y88888888 888888 8888888888888888888888888K 8
echo 8 888 Y8888Y88..88PY88b. Y8b. 888Y8b. 888 "88b 8
echo 8 888 Y888 "Y88P" "Y888 "Y8888 888 "Y8888 888 888 8
echo 8 8
echo 8 d8888 d8b 888 8
echo 8 d88888 Y8P 888 8
echo 8 d88P888 888 8
echo 8 d88P 888.d8888b .d8888b 888.d8888b 888888 8
echo 8 d88P 88888K 88K 88888K 888 8
echo 8 d88P 888"Y8888b."Y8888b.888"Y8888b.888 8
echo 8 d8888888888 X88 X88888 X88Y88b. 8
echo 8 d88P 888 88888P' 88888P'888 88888P' "Y888 8
echo 8 8
echo 8 (To Get back type GOTO start) 8
echo 8 Command Promt Portable 8
echo 8888888888888888888888888888888888888888888888888888888888
set /p com=
GOTO start5
:ms
cls
ipconfig
echo The server is on Port 1
pause
echo Starting...
start Minecraft\Run.bat
ping localhost >nul
ping localhost >nul
GOTO mc
:mc
cls
start Run.bat
GOTO start
:edit
start notepad++.exe "Notelek_Assist.bat"
GOTO reboot
:help
cls
echo Welcome Back %username%!
echo 8888888888888888888888888888888888888888888888888888888888
echo 8 Commands: 8
echo 8 reboot 8
echo 8 exit 8
echo 8 credits 8
echo 8 mute 8
echo 8 unmute 8
echo 8 open cd drive 8
echo 8 term 8
echo 8 screenshot 8
echo 8 color 8
echo 8 teamview 8
echo 8 help 8
echo 8 calc 8
echo 8 search 8
echo 8 cmd 8
echo 8 8
echo 8 Press any key to continue... 8
echo 8 8
echo 8888888888888888888888888888888888888888888888888888888888
pause >nul
GOTO start
:calc
cls
echo Enter your Operator
set/p op=
cls
echo Enter your First Number
set/p num1=
cls
echo Enter your Second Number
set/p num2=
cls
if "%op%"=="asdf" GOTO invalidc
if "%op%"=="exit" GOTO start
if "%op%"=="+" GOTO calc+
if "%op%"=="-" GOTO calc-
if "%op%"=="*" GOTO calc*
if "%op%"=="/" GOTO calc/
:invalidc
cls
echo Type in a valid operator
pause
GOTO reboot
:calc+
cls
set /a answer=num1+num2
echo %num1%+%num2%=%answer%
pause
GOTO start
:calc-
cls
set /a answer=num1-num2
echo %num1%-%num2%=%answer%
pause
GOTO start
:calc*
cls
set /a answer=num1*num2
echo %num1%*%num2%=%answer%
pause
GOTO start
:calc/
cls
set /a answer=num1/num2
echo %num1%/%num2%=%answer%
pause
GOTO start
:security
cls
echo Welcome Back %username%!
echo 88888888888888888888888888888888888888888888888888888888888
echo 8 WARNING: Attempted Acess! Acess Logs in Security folder 8
echo 88888888888888888888888888888888888888888888888888888888888
pause
goto test
:team
cls
echo 888888888888888888888888888888888888888888888888888888888888
echo 8 The Notelek Server 1 Teamviewer id is in your clipboard. 8
echo 888888888888888888888888888888888888888888888888888888888888
nircmd.exe clipboard set Cencored
ping localhots >nul
GOTO start
:eclipse
start eclipse/eclipse.exe
GOTO start
:reboot
start reboot.bat
exit
:credits
cls
echo Notelek assist was coded mostly by Matthew Foulks, Ceo of Notelek Inc.
echo Notelek assist makes use of nircmd, released as freeware by Nirsoft inc.
pause
GOTO start
:mute
nircmd.exe mutesysvolume 1
GOTO start
:unmute
nircmd.exe mutesysvolume 0
GOTO start
:drive
nircmd.exe cdrom open J:
nircmd.exe cdrom open Y:
nircmd.exe cdrom open D:
GOTO start
:term
cls
echo Which process should I terminate?
tasklist
set /p term=
nircmd.exe killprocess %term%
GOTO start
:screenshot
del ../Shot.png
nircmd.exe savescreenshot "../Shot.png"
GOTO start
:invalidcolor
cls
echo Please Enter a valid combo.
pause
GOTO color
:color
cls
echo you can choose your color sceme here (type in the line that you want)
echo white on red
echo gray on black
echo black on white
echo pink on purple
echo aqua on black
echo blue on red
set /p color=
if "%color%"=="asdkf" GOTO invalidcolor
if "%color%"=="white on red" GOTO c1
if "%color%"=="gray on black" GOTO c2
if "%color%"=="black on white" GOTO c3
if "%color%"=="pink on purple" GOTO c4
if "%color%"=="aqua on black" GOTO c5
if "%color%"=="blue on red" GOTO c6
:c1
color 47
echo 47 >file.save
GOTO start
:c2
color 08
echo 08 >file.save
GOTO start
:c3
color 0F
echo 0F >file.save
GOTO start
:c4
color D5
echo D5 >file.save
GOTO start
:c5
color 30
echo 30 >file.save
GOTO start
:c6
color 14
echo 14 >file.save
GOTO start
:search
cls
echo Welcome Back %username%!
echo 8888888888888888888888888888888888888888888888888888888888
echo 8 Beta 0.0.6 8
echo 8 888b 888 888 888 888 8
echo 8 8888b 888 888 888 888 8
echo 8 88888b 888 888 888 888 8
echo 8 888Y88b 888 .d88b. 888888 .d88b. 888 .d88b. 888 888 8
echo 8 888 Y88b888d88""88b888 d8P Y8b888d8P Y8b888 .88P 8
echo 8 888 Y88888888 888888 8888888888888888888888888K 8
echo 8 888 Y8888Y88..88PY88b. Y8b. 888Y8b. 888 "88b 8
echo 8 888 Y888 "Y88P" "Y888 "Y8888 888 "Y8888 888 888 8
echo 8 8
echo 8 d8888 d8b 888 8
echo 8 d88888 Y8P 888 8
echo 8 d88P888 888 8
echo 8 d88P 888.d8888b .d8888b 888.d8888b 888888 8
echo 8 d88P 88888K 88K 88888K 888 8
echo 8 d88P 888"Y8888b."Y8888b.888"Y8888b.888 8
echo 8 d8888888888 X88 X88888 X88Y88b. 8
echo 8 d88P 888 88888P' 88888P'888 88888P' "Y888 8
echo 8 8
echo 8 8
echo 8 Please Enter Your Search Terms 8
echo 8888888888888888888888888888888888888888888888888888888888
set /p SC=
cls
echo Welcome Back %username%!
echo 8888888888888888888888888888888888888888888888888888888888
echo 8 Beta 0.0.6 8
echo 8 888b 888 888 888 888 8
echo 8 8888b 888 888 888 888 8
echo 8 88888b 888 888 888 888 8
echo 8 888Y88b 888 .d88b. 888888 .d88b. 888 .d88b. 888 888 8
echo 8 888 Y88b888d88""88b888 d8P Y8b888d8P Y8b888 .88P 8
echo 8 888 Y88888888 888888 8888888888888888888888888K 8
echo 8 888 Y8888Y88..88PY88b. Y8b. 888Y8b. 888 "88b 8
echo 8 888 Y888 "Y88P" "Y888 "Y8888 888 "Y8888 888 888 8
echo 8 8
echo 8 d8888 d8b 888 8
echo 8 d88888 Y8P 888 8
echo 8 d88P888 888 8
echo 8 d88P 888.d8888b .d8888b 888.d8888b 888888 8
echo 8 d88P 88888K 88K 88888K 888 8
echo 8 d88P 888"Y8888b."Y8888b.888"Y8888b.888 8
echo 8 d8888888888 X88 X88888 X88Y88b. 8
echo 8 d88P 888 88888P' 88888P'888 88888P' "Y888 8
echo 8 8
echo 8 8
echo 8 Working... 8
echo 8888888888888888888888888888888888888888888888888888888888
start "" /b "PortableApps\GoogleChromePortable\GoogleChromePortable.exe" "http://www.google.com/search?q=%SC%"
ping localhost >nul
GOTO test
:docs
cls
echo Welcome Back %username%!
echo 8888888888888888888888888888888888888888888888888888888888
echo 8 Beta 0.0.6 8
echo 8 888b 888 888 888 888 8
echo 8 8888b 888 888 888 888 8
echo 8 88888b 888 888 888 888 8
echo 8 888Y88b 888 .d88b. 888888 .d88b. 888 .d88b. 888 888 8
echo 8 888 Y88b888d88""88b888 d8P Y8b888d8P Y8b888 .88P 8
echo 8 888 Y88888888 888888 8888888888888888888888888K 8
echo 8 888 Y8888Y88..88PY88b. Y8b. 888Y8b. 888 "88b 8
echo 8 888 Y888 "Y88P" "Y888 "Y8888 888 "Y8888 888 888 8
echo 8 8
echo 8 d8888 d8b 888 8
echo 8 d88888 Y8P 888 8
echo 8 d88P888 888 8
echo 8 d88P 888.d8888b .d8888b 888.d8888b 888888 8
echo 8 d88P 88888K 88K 88888K 888 8
echo 8 d88P 888"Y8888b."Y8888b.888"Y8888b.888 8
echo 8 d8888888888 X88 X88888 X88Y88b. 8
echo 8 d88P 888 88888P' 88888P'888 88888P' "Y888 8
echo 8 8
echo 8 8
echo 8 Working... 8
echo 8888888888888888888888888888888888888888888888888888888888
start "" /b "PortableApps\GoogleChromePortable\GoogleChromePortable.exe" "http://174.108.108.195:8080/login/"
cls
GOTO start