forked from MarginallyClever/GcodeSender
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart64.bat
More file actions
23 lines (19 loc) · 686 Bytes
/
Copy pathstart64.bat
File metadata and controls
23 lines (19 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
:: special thanks to http://rgagnon.com/javadetails/java-0642.html
:: http://stackoverflow.com/questions/638301/discover-from-a-batch-file-where-is-java-installed
@echo off
cls
setlocal ENABLEEXTENSIONS
::
:: get the current version
::
FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment" /v CurrentVersion') DO set CurVer=%%B
FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment\%CurVer%" /v JavaHome') DO set JAVA_HOME=%%B
if defined JAVA_HOME (
@echo The current Java runtime is %CurVer%
) else (
@echo Java not found.
goto end
)
"%JAVA_HOME%\bin\java.exe" -jar gcodesender.jar
:end
@pause