Batch Files - Yash-777/LearnJava GitHub Wiki

@echo off
REM @echo off means avoids commented info displaying in console.
REM set "var=value"
set "CATALINA_HOME=D:\Yashwanth\D Drive\Apache\apache-tomcat-7.0.37"
echo %CATALINA_HOME%

Tomcat bin « catalina.bat

rem Guess CATALINA_HOME if not defined
set "CURRENT_DIR=%cd%"

set "%CATALINA_HOME%" == "D:\Yashwanth\D Drive\Apache\apache-tomcat-7.0.37"

rem ...

rem Ensure that any user defined CLASSPATH variables are not used on startup,
rem but allow them to be specified in setenv.bat, in rare case when it is needed.
set CLASSPATH=

rem Get standard environment variables
if not exist "%CATALINA_BASE%\bin\setenv.bat" goto checkSetenvHome
call "%CATALINA_BASE%\bin\setenv.bat"
goto setenvDone
:checkSetenvHome
if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
:setenvDone

« setenv.bat

set CATALINA_HOME = "D:\Yashwanth\D Drive\Apache\apache-tomcat-7.0.37"

set "JRE_HOME=%ProgramFiles%\Java\jdk1.6.0_45\jre"
set "JAVA_HOME=%ProgramFiles%\Java\jdk1.6.0_45"

Lock Screen

rundll32.exe user32.dll,LockWorkStation

Shutdown System

REM echo 1= 1 min
shutdown -s -t 0

Temp, Pre-fetch Clean

@echo off
del /s /f /q c:\windows\temp\*.*
rd /s /q c:\windows\temp
md c:\windows\temp
del /s /f /q C:\WINDOWS\Prefetch
del /s /f /q %temp%\*.*
rd /s /q %temp%
md %temp%
deltree /y c:\windows\tempor~1
deltree /y c:\windows\temp
deltree /y c:\windows\Prefetch
deltree /y c:\windows\tmp
deltree /y c:\windows\ff*.tmp
deltree /y c:\windows\history
deltree /y c:\windows\cookies
deltree /y c:\windows\recent
deltree /y c:\windows\spool\printers
del c:\WIN386.SWP
cls