get current path in DOS-Batch
need to get the current path your batch file is executed in? Try this:
echo %~dp0%jre
need to get the current path your batch file is executed in? Try this:
echo %~dp0%jre
To get the year in format YYYY in a DOS-Batch check this out:
@echo off
set date=%date%
set year=%date:~6,4%
echo %year%
Cheatsheat for DOS batches
| Comment | REM This is a comment in a DOS batch file |
ECHO Hello World! |
|
| Arguments | %1 %2 %3 |
| if | IF (condition) ( |
| for | for /l %%x in (1, 1, 5) do ( REM Do stuff) |
| Exit | EXIT |
| Get return code | ECHO %errorlevel% |