diff --git a/src/main/java/com/insigma/utils/WinCommandUtil.java b/src/main/java/com/insigma/utils/WinCommandUtil.java index ea4ca2d..7778b48 100644 --- a/src/main/java/com/insigma/utils/WinCommandUtil.java +++ b/src/main/java/com/insigma/utils/WinCommandUtil.java @@ -6,7 +6,8 @@ import org.springframework.util.StringUtils; import java.io.*; /** - * CommandImpUtil + * CommandImpUtil Windows 下执行命令
+ * 【注意】 目录使用的 >>> 下划线 <<< * * @author admin */ diff --git a/src/test/java/com/insigma/utils/32b.bat b/src/test/java/com/insigma/utils/32b.bat new file mode 100644 index 0000000..746508c --- /dev/null +++ b/src/test/java/com/insigma/utils/32b.bat @@ -0,0 +1,120 @@ +@Echo Off +Title 32λ÷עֶðװ· & Color 1A +cd %systemroot%\system32 +call :IsAdmin + +set /p InstallPath_value=빫Աϵͳװ·D:/hzb2020: +echo װ·%InstallPath_value% + +for /f "tokens=2" %%a in ('systeminfo^|findstr õڴ') do ( +for /f "tokens=1,2 delims=," %%y in ("%%a") do if %%y%%z gtr 2048 (set JvmMx_value=1024 +set JvmMs_value=512) else (set JvmMx_value=512 +set JvmMs_value=256)) +echo JvmMs_value%JvmMs_value% +echo JvmMx_value%JvmMx_value% + +net stop GWY20_Mysql +net stop GWY20_Tomcat + + + + +Reg.exe delete "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql" /f +Reg.exe delete "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /f +Reg.exe delete "HKLM\SYSTEM\ControlSet002\Services\GWY20_Mysql" /f +Reg.exe delete "HKLM\SYSTEM\ControlSet002\Services\GWY20_Tomcat" /f +Reg.exe delete "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql" /f +Reg.exe delete "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /f +Reg.exe delete "HKLM\SOFTWARE\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql" /v "Type" /t REG_DWORD /d "16" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql" /v "Start" /t REG_DWORD /d "2" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql" /v "ErrorControl" /t REG_DWORD /d "1" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql" /v "ImagePath" /t REG_EXPAND_SZ /d "%InstallPath_value%\mysql\bin\mysqld GWY20_Mysql" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql" /v "DisplayName" /t REG_SZ /d "GWY20_Mysql" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql" /v "ObjectName" /t REG_SZ /d "LocalSystem" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql\Security" /v "Security" /t REG_BINARY /d "01001480900000009c000000140000003000000002001c000100000002801400ff010f00010100000000000100000000020060000400000000001400fd01020001010000000000051200000000001800ff010f0001020000000000052000000020020000000014008d01020001010000000000050b00000000001800fd01020001020000000000052000000023020000010100000000000512000000010100000000000512000000" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql\Enum" /v "0" /t REG_SZ /d "Root\LEGACY_GWY20_MYSQL\0000" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql\Enum" /v "Count" /t REG_DWORD /d "1" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql\Enum" /v "NextInstance" /t REG_DWORD /d "1" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Mysql" /v "Type" /t REG_DWORD /d "16" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Mysql" /v "Start" /t REG_DWORD /d "2" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Mysql" /v "ErrorControl" /t REG_DWORD /d "1" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Mysql" /v "ImagePath" /t REG_EXPAND_SZ /d "%InstallPath_value%\mysql\bin\mysqld GWY20_Mysql" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Mysql" /v "DisplayName" /t REG_SZ /d "GWY20_Mysql" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Mysql" /v "ObjectName" /t REG_SZ /d "LocalSystem" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Mysql\Security" /v "Security" /t REG_BINARY /d "01001480900000009c000000140000003000000002001c000100000002801400ff010f00010100000000000100000000020060000400000000001400fd01020001010000000000051200000000001800ff010f0001020000000000052000000020020000000014008d01020001010000000000050b00000000001800fd01020001020000000000052000000023020000010100000000000512000000010100000000000512000000" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql" /v "Type" /t REG_DWORD /d "16" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql" /v "Start" /t REG_DWORD /d "2" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql" /v "ErrorControl" /t REG_DWORD /d "1" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql" /v "ImagePath" /t REG_EXPAND_SZ /d "%InstallPath_value%\mysql\bin\mysqld GWY20_Mysql" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql" /v "DisplayName" /t REG_SZ /d "GWY20_Mysql" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql" /v "ObjectName" /t REG_SZ /d "LocalSystem" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql\Security" /v "Security" /t REG_BINARY /d "01001480900000009c000000140000003000000002001c000100000002801400ff010f00010100000000000100000000020060000400000000001400fd01020001010000000000051200000000001800ff010f0001020000000000052000000020020000000014008d01020001010000000000050b00000000001800fd01020001020000000000052000000023020000010100000000000512000000010100000000000512000000" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql\Enum" /v "0" /t REG_SZ /d "Root\LEGACY_GWY20_MYSQL\0000" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql\Enum" /v "Count" /t REG_DWORD /d "1" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql\Enum" /v "NextInstance" /t REG_DWORD /d "1" /f +Reg.exe add "HKLM\SOFTWARE\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Java" /v "Jvm" /t REG_SZ /d "%InstallPath_value%\tomcat8/JDK1.8\jre\bin\server\jvm.dll" /f +Reg.exe add "HKLM\SOFTWARE\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Java" /v "Options" /t REG_MULTI_SZ /d "-Dcatalina.home=%InstallPath_value%\tomcat8\0-Dcatalina.base=%InstallPath_value%\tomcat8\0-Djava.endorsed.dirs=%InstallPath_value%\tomcat8\endorsed\0-Djava.io.tmpdir=%InstallPath_value%\tomcat8\temp\0-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager\0-Djava.util.logging.config.file=%InstallPath_value%\tomcat8\conf\logging.properties\0-Dfile.encoding=GBK\0-XX:PermSize=128m\0-XX:MaxPermSize=256m" /f +Reg.exe add "HKLM\SOFTWARE\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Java" /v "Classpath" /t REG_SZ /d "%InstallPath_value%\tomcat8\bin\bootstrap.jar;%InstallPath_value%\tomcat8\bin\tomcat-juli.jar" /f +Reg.exe add "HKLM\SOFTWARE\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Java" /v "JvmMs" /t REG_DWORD /d "%JvmMs_value%" /f +Reg.exe add "HKLM\SOFTWARE\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Java" /v "JvmMx" /t REG_DWORD /d "%JvmMx_value%" /f +Reg.exe add "HKLM\SOFTWARE\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Log" /v "Path" /t REG_SZ /d "%InstallPath_value%\tomcat8\logs" /f +Reg.exe add "HKLM\SOFTWARE\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Log" /v "StdError" /t REG_SZ /d "auto" /f +Reg.exe add "HKLM\SOFTWARE\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Log" /v "StdOutput" /t REG_SZ /d "auto" /f +Reg.exe add "HKLM\SOFTWARE\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Start" /v "WorkingPath" /t REG_SZ /d "%InstallPath_value%\tomcat8" /f +Reg.exe add "HKLM\SOFTWARE\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Start" /v "Class" /t REG_SZ /d "org.apache.catalina.startup.Bootstrap" /f +Reg.exe add "HKLM\SOFTWARE\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Start" /v "Params" /t REG_MULTI_SZ /d "start" /f +Reg.exe add "HKLM\SOFTWARE\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Start" /v "Mode" /t REG_SZ /d "jvm" /f +Reg.exe add "HKLM\SOFTWARE\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Stop" /v "WorkingPath" /t REG_SZ /d "%InstallPath_value%\tomcat8" /f +Reg.exe add "HKLM\SOFTWARE\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Stop" /v "Class" /t REG_SZ /d "org.apache.catalina.startup.Bootstrap" /f +Reg.exe add "HKLM\SOFTWARE\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Stop" /v "Params" /t REG_MULTI_SZ /d "stop" /f +Reg.exe add "HKLM\SOFTWARE\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Stop" /v "Mode" /t REG_SZ /d "jvm" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "Type" /t REG_DWORD /d "16" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "Start" /t REG_DWORD /d "2" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "ErrorControl" /t REG_DWORD /d "1" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "ImagePath" /t REG_EXPAND_SZ /d "%InstallPath_value%\tomcat8\bin\Tomcat8.exe //RS//GWY20_Tomcat" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "DisplayName" /t REG_SZ /d "GWY_Tomcat" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "DependOnService" /t REG_MULTI_SZ /d "Tcpip\0Afd" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "DependOnGroup" /t REG_MULTI_SZ /d "" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "ObjectName" /t REG_SZ /d "NT Authority\LocalService" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "Description" /t REG_SZ /d "Apache Tomcat 8.5.55 Server - https://tomcat.apache.org/" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat\Parameters" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat\Security" /v "Security" /t REG_BINARY /d "01001480900000009c000000140000003000000002001c000100000002801400ff010f00010100000000000100000000020060000400000000001400fd01020001010000000000051200000000001800ff010f0001020000000000052000000020020000000014008d01020001010000000000050b00000000001800fd01020001020000000000052000000023020000010100000000000512000000010100000000000512000000" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat\Enum" /v "0" /t REG_SZ /d "Root\LEGACY_GWY20_TOMCAT\0000" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat\Enum" /v "Count" /t REG_DWORD /d "1" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat\Enum" /v "NextInstance" /t REG_DWORD /d "1" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Tomcat" /v "Type" /t REG_DWORD /d "16" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Tomcat" /v "Start" /t REG_DWORD /d "3" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Tomcat" /v "ErrorControl" /t REG_DWORD /d "1" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Tomcat" /v "ImagePath" /t REG_EXPAND_SZ /d "%InstallPath_value%\tomcat8\bin\Tomcat8.exe //RS//GWY20_Tomcat" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Tomcat" /v "DisplayName" /t REG_SZ /d "Apache Tomcat 8.5 GWY20_Tomcat" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Tomcat" /v "DependOnService" /t REG_MULTI_SZ /d "Tcpip\0Afd" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Tomcat" /v "DependOnGroup" /t REG_MULTI_SZ /d "" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Tomcat" /v "ObjectName" /t REG_SZ /d "NT Authority\LocalService" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Tomcat" /v "Description" /t REG_SZ /d "Apache Tomcat 8.5.55 Server - https://tomcat.apache.org/" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Tomcat\Parameters" /f +Reg.exe add "HKLM\SYSTEM\ControlSet002\Services\GWY20_Tomcat\Security" /v "Security" /t REG_BINARY /d "01001480900000009c000000140000003000000002001c000100000002801400ff010f00010100000000000100000000020060000400000000001400fd01020001010000000000051200000000001800ff010f0001020000000000052000000020020000000014008d01020001010000000000050b00000000001800fd01020001020000000000052000000023020000010100000000000512000000010100000000000512000000" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "Type" /t REG_DWORD /d "16" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "Start" /t REG_DWORD /d "2" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "ErrorControl" /t REG_DWORD /d "1" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "ImagePath" /t REG_EXPAND_SZ /d "%InstallPath_value%\tomcat8\bin\Tomcat8.exe //RS//GWY20_Tomcat" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "DisplayName" /t REG_SZ /d "GWY_Tomcat" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "DependOnService" /t REG_MULTI_SZ /d "Tcpip\0Afd" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "DependOnGroup" /t REG_MULTI_SZ /d "" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "ObjectName" /t REG_SZ /d "NT Authority\LocalService" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "Description" /t REG_SZ /d "Apache Tomcat 8.5.55 Server - https://tomcat.apache.org/" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat\Parameters" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat\Security" /v "Security" /t REG_BINARY /d "01001480900000009c000000140000003000000002001c000100000002801400ff010f00010100000000000100000000020060000400000000001400fd01020001010000000000051200000000001800ff010f0001020000000000052000000020020000000014008d01020001010000000000050b00000000001800fd01020001020000000000052000000023020000010100000000000512000000010100000000000512000000" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat\Enum" /v "0" /t REG_SZ /d "Root\LEGACY_GWY20_TOMCAT\0000" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat\Enum" /v "Count" /t REG_DWORD /d "1" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat\Enum" /v "NextInstance" /t REG_DWORD /d "1" /f +Exit + +:IsAdmin +Reg.exe query "HKU\S-1-5-19\Environment" +If Not %ERRORLEVEL% EQU 0 ( + Cls & Echo You must have administrator rights to continue ... + Pause & Exit +) +Cls +goto:eof diff --git a/src/test/java/com/insigma/utils/64b.bat b/src/test/java/com/insigma/utils/64b.bat new file mode 100644 index 0000000..278a424 --- /dev/null +++ b/src/test/java/com/insigma/utils/64b.bat @@ -0,0 +1,87 @@ + +@Echo Off +Title 32λ÷עֶðװ· & Color 1A +cd %systemroot%\system32 +call :IsAdmin + +set /p InstallPath_value=빫Աϵͳװ·D:/hzb2020: +echo װ·%InstallPath_value% + +for /f "tokens=2" %%a in ('systeminfo^|findstr õڴ') do ( + +for /f "tokens=1,2 delims=," %%y in ("%%a") do if %%y%%z gtr 2048 (set JvmMx_value=1024 +set JvmMs_value=512) else (set JvmMx_value=512 +set JvmMs_value=256) +) +echo JvmMs_value%JvmMs_value% +echo JvmMx_value%JvmMx_value% + +net stop GWY20_Mysql +net stop GWY20_Tomcat +Reg.exe delete "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql" /f +Reg.exe delete "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /f +Reg.exe delete "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql" /f +Reg.exe delete "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /f +Reg.exe delete "HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql" /v "Type" /t REG_DWORD /d "16" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql" /v "Start" /t REG_DWORD /d "2" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql" /v "ErrorControl" /t REG_DWORD /d "1" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql" /v "ImagePath" /t REG_EXPAND_SZ /d "%InstallPath_value%\mysql\bin\mysqld GWY20_Mysql" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql" /v "DisplayName" /t REG_SZ /d "GWY20_Mysql" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql" /v "WOW64" /t REG_DWORD /d "332" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Mysql" /v "ObjectName" /t REG_SZ /d "LocalSystem" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "Type" /t REG_DWORD /d "16" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "Start" /t REG_DWORD /d "2" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "ErrorControl" /t REG_DWORD /d "1" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "ImagePath" /t REG_EXPAND_SZ /d "%InstallPath_value%\tomcat8\bin\Tomcat8.exe //RS//GWY20_Tomcat" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "DisplayName" /t REG_SZ /d "GWY20_Tomcat" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "DependOnService" /t REG_MULTI_SZ /d "Tcpip\0Afd" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "WOW64" /t REG_DWORD /d "332" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "ObjectName" /t REG_SZ /d "NT Authority\LocalService" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat" /v "Description" /t REG_SZ /d "Apache Tomcat 8.5.55 Server - https://tomcat.apache.org/" /f +Reg.exe add "HKLM\SYSTEM\ControlSet001\Services\GWY20_Tomcat\Parameters" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql" /v "Type" /t REG_DWORD /d "16" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql" /v "Start" /t REG_DWORD /d "2" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql" /v "ErrorControl" /t REG_DWORD /d "1" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql" /v "ImagePath" /t REG_EXPAND_SZ /d "%InstallPath_value%\mysql\bin\mysqld --defaults-file=%InstallPath_value%\mysql\my.ini GWY20_Mysql" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql" /v "DisplayName" /t REG_SZ /d "GWY20_Mysql" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql" /v "WOW64" /t REG_DWORD /d "332" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Mysql" /v "ObjectName" /t REG_SZ /d "LocalSystem" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "Type" /t REG_DWORD /d "16" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "Start" /t REG_DWORD /d "2" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "ErrorControl" /t REG_DWORD /d "1" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "ImagePath" /t REG_EXPAND_SZ /d "%InstallPath_value%\tomcat8\bin\Tomcat8.exe //RS//GWY20_Tomcat" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "DisplayName" /t REG_SZ /d "GWY20_Tomcat" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "DependOnService" /t REG_MULTI_SZ /d "Tcpip\0Afd" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "WOW64" /t REG_DWORD /d "332" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "ObjectName" /t REG_SZ /d "NT Authority\LocalService" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat" /v "Description" /t REG_SZ /d "Apache Tomcat 8.5.55 Server - https://tomcat.apache.org/" /f +Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\GWY20_Tomcat\Parameters" /f +Reg.exe add "HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Java" /v "Jvm" /t REG_SZ /d "%InstallPath_value%\tomcat8/JDK1.8/jre\bin\server\jvm.dll" /f +Reg.exe add "HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Java" /v "Options" /t REG_MULTI_SZ /d "-Dcatalina.home=%InstallPath_value%\tomcat8\0-Dcatalina.base=%InstallPath_value%\tomcat8\0-Djava.endorsed.dirs=%InstallPath_value%\tomcat8\endorsed\0-Djava.io.tmpdir=%InstallPath_value%\tomcat8\temp\0-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager\0-Djava.util.logging.config.file=%InstallPath_value%\tomcat8\conf\logging.properties\0-Dfile.encoding=GBK\0-XX:PermSize=128m\0-XX:MaxPermSize=256m" /f +Reg.exe add "HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Java" /v "Classpath" /t REG_SZ /d "%InstallPath_value%\tomcat8\bin\bootstrap.jar;%InstallPath_value%\tomcat8\bin\tomcat-juli.jar" /f +Reg.exe add "HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Java" /v "JvmMs" /t REG_DWORD /d "%JvmMs_value%" /f +Reg.exe add "HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Java" /v "JvmMx" /t REG_DWORD /d "%JvmMx_value%" /f +Reg.exe add "HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Log" /v "Path" /t REG_SZ /d "%InstallPath_value%\tomcat8\logs" /f +Reg.exe add "HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Log" /v "StdError" /t REG_SZ /d "auto" /f +Reg.exe add "HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Log" /v "StdOutput" /t REG_SZ /d "auto" /f +Reg.exe add "HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Start" /v "WorkingPath" /t REG_SZ /d "%InstallPath_value%\tomcat8" /f +Reg.exe add "HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Start" /v "Class" /t REG_SZ /d "org.apache.catalina.startup.Bootstrap" /f +Reg.exe add "HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Start" /v "Params" /t REG_MULTI_SZ /d "start" /f +Reg.exe add "HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Start" /v "Mode" /t REG_SZ /d "jvm" /f +Reg.exe add "HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Stop" /v "WorkingPath" /t REG_SZ /d "%InstallPath_value%\tomcat8" /f +Reg.exe add "HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Stop" /v "Class" /t REG_SZ /d "org.apache.catalina.startup.Bootstrap" /f +Reg.exe add "HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Stop" /v "Params" /t REG_MULTI_SZ /d "stop" /f +Reg.exe add "HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\GWY20_Tomcat\Parameters\Stop" /v "Mode" /t REG_SZ /d "jvm" /f +echo ԡ +pause +Exit + +:IsAdmin +Reg.exe query "HKU\S-1-5-19\Environment" +If Not %ERRORLEVEL% EQU 0 ( + Cls & ùԱȨ... + Pause & Exit +) +Cls +goto:eof