forked from Just-Some-Bots/MusicBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runbot.bat
38 lines (28 loc) · 826 Bytes
/
runbot.bat
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
35
36
37
38
@ECHO off
CHCP 65001 > NUL
CD /d "%~dp0"
SETLOCAL ENABLEEXTENSIONS
SET KEY_NAME="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
SET VALUE_NAME=HideFileExt
FOR /F "usebackq tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO (
SET ValueName=%%A
SET ValueType=%%B
SET ValueValue=%%C
)
IF x%ValueValue:0x0=%==x%ValueValue% (
ECHO Unhiding file extensions...
START CMD /c REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v HideFileExt /t REG_DWORD /d 0 /f
)
ENDLOCAL
IF EXIST %SYSTEMROOT%\py.exe (
CMD /k %SYSTEMROOT%\py.exe run.py
EXIT
)
python --version > NUL 2>&1
IF %ERRORLEVEL% NEQ 0 GOTO nopython
CMD /k python run.py
GOTO end
:nopython
ECHO ERROR: Python has either not been installed or not added to your PATH.
:end
PAUSE