-
Notifications
You must be signed in to change notification settings - Fork 4
/
auto-config.bat
53 lines (39 loc) · 1.43 KB
/
auto-config.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
@echo off
REM Auto Config
REM Author : pigochu@gmail.com
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
pushd "%CD%"
CD /D "%~dp0"
:--------------------------------------
SET WORKING_DIRECTORY=%~dp0
CD "%WORKING_DIRECTORY%"
SET ORIG_PHP_INI_SCAN_DIR=%PHP_INI_SCAN_DIR%
SET PHP_INI_SCAN_DIR=%WORKING_DIRECTORY%\php56\conf.cli.d
"%WORKING_DIRECTORY%\php56\php" -c "%WORKING_DIRECTORY%\php56" -dextension_dir=ext -dextension=php_com_dotnet.dll "%WORKING_DIRECTORY%\bin\scripts\auto-config.php"
SET PHP_INI_SCAN_DIR=%ORIG_PHP_INI_SCAN_DIR%
ECHO UnRegister Apache24 as Service
%WORKING_DIRECTORY%\Apache24\bin\httpd -k uninstall
ECHO Register Apache24 as Service
%WORKING_DIRECTORY%\Apache24\bin\httpd -k install
ECHO Auto Config is done.
ECHO You can test URL http://localhost
ECHO phpMyadmin URL is http://localhost/phpmyadmin/
ECHO "Enjoy it."
pause
@echo on