forked from npocmaka/batch.scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavaExtInstaller.bat
More file actions
19 lines (16 loc) · 690 Bytes
/
javaExtInstaller.bat
File metadata and controls
19 lines (16 loc) · 690 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
@echo off
:: requires Admin permissions
:: allows a files with .JAVA (in this case ) extension to act like .bat/.cmd files.
:: Will create a 'caller.bat' asociated with the extension
:: which will create a temp .bat file on each call (you can consider this as cheating)
:: and will call it.
:: Have on mind that the %0 argument will be lost.
rem :: "installing" a caller.
if not exist "c:\javaCaller.bat" (
echo @echo off
echo copy "%%~nx1" "%%temp%%\%%~nx1.bat" /Y ^>nul
echo "%%temp%%\%%~nx1.bat" %%*
) > c:\javaCaller.bat
rem :: associating file extension
assoc .java=javafile
ftype javafile=c:\javaCaller "%%1" %%*