Win2003 Iis+mysql Service Management Assistant _win Server

Source: Internet
Author: User
Tags current time echo 7 file copy goto
Tip: If you install MySQL service name is not MySQL, please use a text editor to open the bat file, batch replacement file MySQL.
Mysql.bat Program Source Code
Usage: Save the following file copy for Mysql.bat Direct operation, if your server prohibits the operation of the bat, please modify it yourself.
Copy Code code as follows:

@Echo off
TITLE Iis6+mysql Service Management Assistant v0.1

: Start
Cls
COLOR 1f
:: Change the console output color using the color command
MODE con:cols=31 lines=18
:: Mode statement to set the width and height of the form
Set tm1=%time:~0,2%
Set tm2=%time:~3,2%
Set tm3=%time:~6,2%
Echo%date%%tm1% point%tm2% minute%tm3% seconds
Echo ==============================
Echo Select the action you want to make, and then press ENTER
echo───────────────
Echo 1. Stopping the IIS Service
Echo 2. Start the IIS Service
Echo 3. Restart the IIS Service
Echo 4. Stop MySQL Service
Echo 5. Start the MySQL service
Echo 6. Restart the MySQL service
Echo 7. Refresh Current Time
Echo 8. Author Link
Echo 9. Exit this program
Echo.

: Menu
Set choice=
set/p choice= Selection:
:: Set Variable "Choice" for user-entered characters
If not "%choice%" = "" Set choice=%choice:~0,1%
:: If the input is greater than 1 digits, take the 1th digit, such as enter 132, the return value is 1
Echo.
if/i "%choice%" = = "1" Goto iisstop
if/i "%choice%" = = "2" Goto Iisstart
if/i "%choice%" = = "3" Goto Iisrestart
if/i "%choice%" = = "4" Goto mysqlstop
if/i "%choice%" = = "5" Goto Mysqlstart
if/i "%choice%" = = "6" Goto Mysqlrestart
if/i "%choice%" = = "7" Goto start
if/i "%choice%" = = "8" Goto support
if/i "%choice%" = = "9" Goto end
:: To avoid a program exception with a null or white return value, add double quotes outside the variable
:: Note that the IF statement requires a double equal number
:: If the character entered is not the above number, it will be returned to re-enter
The Echo selection is invalid, please re-enter
Echo.
Goto start

: Iisstop
Cls
MODE con:cols=55 lines=15
COLOR 70

net stop w3svc
net stop iisadmin/y

Echo.
Echo Please press any key to return ...
PAUSE >nul
Goto start


: Iisstart
Cls
MODE con:cols=55 lines=15
COLOR 70

net start w3svc

Echo.
Echo Please press any key to return ...
PAUSE >nul
Goto start


: Iisrestart
Cls
MODE con:cols=31 lines=15
COLOR 70

Iisreset.exe

Echo.
Echo Please press any key to return ...
PAUSE >nul
Goto start


: Mysqlstop
Cls
MODE con:cols=31 lines=15
COLOR 70

net stop MySQL

Echo.
Echo Please press any key to return ...
PAUSE >nul
Goto start


: Mysqlstart
Cls
MODE con:cols=31 lines=15
COLOR 70

net start MySQL

Echo.
Echo Please press any key to return ...
PAUSE >nul
Goto start


: Mysqlrestart
Cls
MODE con:cols=31 lines=15
COLOR 70

net stop MySQL
net start MySQL

Echo.
Echo Please press any key to return ...
PAUSE >nul
Goto start


: Support
Start IExplore "ideacm.com.cn/read.php?72"
Goto start

The article comes from: http://ideacm.com.cn/read.php?72
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.