This repository was archived by the owner on Apr 18, 2022. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobalify.bat
More file actions
Latest commit
34 lines (29 loc) · 1.02 KB
/
Copy pathglobalify.bat
File metadata and controls
34 lines (29 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@echooff
echo.
:ask
choice /N /C:NY /M "Do you realy want to globalify this folder (press y or n): "
iferrorlevel255goto ask
iferrorlevel3goto pick3
iferrorlevel2goto do
iferrorlevel1echo canceled &goto end
iferrorlevel0goto ask
:do
setlocalENABLEEXTENSIONS
setREG=C:\Windows\System32\reg.exe
setKEY_NAME="HKCU\Software\Microsoft\Command Processor"
FOR /F "usebackq tokens=3*"%%AIN (`%REG%QUERY%KEY_NAME% /v AutoRun`) DO (
setappdir=%%A%%B
)
echo :: file: %cd%\mcscript-java-init.bat >> mcscript-java-init.bat
echo :: This file is automatically generated by the mcscript java globalify file >> mcscript-java-init.bat
echo. >> mcscript-java-init.bat
echo @echo off >> mcscript-java-init.bat
echo set PATH=%%PATH%%;;%cd%; >> mcscript-java-init.bat
echo%appdir%>> mcscript-java-init.bat
del mcscript.bat
echo @echo off>>mcscript.bat
echo JAVA -jar "%cd%\mcscript.jar"%%*>>mcscript.bat
%REG% add %KEY_NAME% /v AutoRun ^ /t REG_EXPAND_SZ /d "%cd%\mcscript-java-init.bat" /f >nul
echo Done correctly!
echo.
:end