-
- ::code by Novaa bbs.bathome.net 2007/12/13
- @echo off&color 02&Title WebShell管理器&mode con cols=80 lines=25
- set "Table=echo\&echo\"
- set "Back= 返回主菜单请输入:B"
- set "Twice= 任意键以继续!&echo\"
- set "Menu=endlocal&set Again=&goto Menu"
- if not exist WebShell.ini cd.>WebShell.ini
- :Menu
- cls&setlocal enabledelayedexpansion
- set "Function=1.添加网站分类,2.添加网站(WebShell),3.打开/删除网站,4.删除网站分类,5.退出"
- for /f "delims=" %%i in (WebShell.ini) do (
- set Get=%%i&set /a Type_Num+=1
- if "!Get:~0,1!"=="/" (
- set /a Type_1+=1&set !Type_1!=!Get:~1!
- set Type=!Get:~1!&set !Type!=!Get:~1!
- set Type_Num=0
- ) else (set !Type!!Type_Num!=%%i)
- )
- cls&echo\
- if defined Again goto :!Again!
- %Table%
- for %%i in (!Function!) do set /p= %%i<nul&echo\&echo\
- set /p Choice=请选择功能:
- echo\&echo\
- if "%Choice%"=="5" exit
- for %%i in (1,2,3,4) do if "%Choice%"=="%%i" set Go=1
- if defined Go (goto :Choice%Choice%) else echo 错误的输入!&ping /n 3 127.1>nul&goto :Menu
- )
- :Choice1
- cls&%Table%
- set /p= 请输入你想添加的网站类别:<nul
- set /p WebType=
- if defined %WebType% echo 此类名已经存在!&ping /n 3 127.1>nul&cls&%Table%&goto :Choice1
- echo /!WebType!>>WebShell.ini&cls&%Table%
- echo 类别已经成功添加!
- %Table%
- echo %Twice%
- echo %Back%
- set /p Choice_1=
- if /i "%Choice_1%"=="b" %Menu%
- endlocal&set Again=Choice1&goto Menu
- :Choice2
- cls&%Table%
- call :Echo
- set /p Choice_2= 请选择你想添加的网站所属分类:
- set "Type_1=/!%Choice_2%!"
- cls&%Table%
- set /p WebDesc= 请输入网站的描述:
- %Table%
- set /p WebName= 请输入你想添加的网站域名:
- %Table%
- set /p WebPassword= 请输入网站密码:
- ::网站添加时间
- set date=%date%&set time=%time%
- set date=%date:~0,-4%&set time=%time:~0,-3%
- set "AddTime=%date% %time%"
- set "WebOk=!WebDesc!+!WebName!+!WebPassword!+!AddTime!"
- for /f "delims=" %%i in (WebShell.ini) do (
- echo %%i>>WebShell.txt
- if /i "%%i"=="!Type_1!" echo !%Choice_2%!+!WebOk!>>WebShell.txt
- )
- del WebShell.ini &ren "WebShell.txt" "WebShell.ini"
- %Table%
- echo 网站添加成功!&%Table%&echo %Twice%&%Table%&echo %Back%
- set /p Choice_12=
- if /i "%Choice_12%"=="b" %Menu%
- endlocal&set Again=Choice2&goto Menu
- :Choice3
- cls&%Table%
- call :Echo
- %Table%
- echo %Back%
- %Table%
- set /p Choice_3= 请选择你想打开/删除的网站所属分类:
- if /i "%Choice_3%"=="B" %Menu%
- set /a Choice_33=Choice_3+1
- if not defined !%Choice_33%! goto :Next_1
- :Next
- cls
- call set OpenType=/!%Choice_3%!
- call set OpenType_1=/!%Choice_33%!
- for /f "tokens=1* delims=:" %%i in ('findstr /n .* WebShell.ini') do (
- if "%%j"=="%OpenType%" set StartLine=%%i
- if "%%j"=="%OpenType_1%" set EndLineNum=%%i
- )
- set /a Choice_Num=%EndLineNum%-%StartLine%-1
- echo ===网站描述------网站后台------网站密码------网站添加时间===
- for /l %%i in (1 1 %Choice_Num%) do (
- call set Type_Name=!%Choice_3%!%%i
- call set TypeName=%%!Type_name!%%
- call :EchoWeb
- )
- %Table%
- echo 打开网站输入字母O+网站编号(比如O1)
- echo 删除网站输入字母D+网站编号(比如D1)
- echo\&echo %Twice%
- echo %Back%
- set /p Choice_Next=
- set Choice_Next11=%Choice_Next:~0,1%
- set Choice_Next12=%Choice_Next:~1,1%
- if /i "!Choice_Next11!"=="D" call :DelW
- if /i "!Choice_Next11!"=="o" call :OpenWeb
- if /i "!Choice_Next11!"=="B" %Menu%
- endlocal&set Again=Choice3&goto Menu
- :Next_1
- cls
- call set OpenType=/!%Choice_3%!
- set EndLineNum=0
- for /f "delims=" %%i in (WebShell.ini) do set /a EndLineNum+=1
- for /f "tokens=1* delims=:" %%i in ('findstr /n .* WebShell.ini') do if "%%j"=="%OpenType%" set StartLine=%%i
- set /a Choice_Num=%EndLineNum%-%StartLine%
- echo ===网站描述------网站后台------网站密码------网站添加时间===
- for /l %%i in (1 1 %Choice_Num%) do (
- call set Type_Name=!%Choice_3%!%%i
- call set TypeName=%%!Type_name!%%
- call :EchoWeb
- )
- %Table%
- echo 打开网站输入O+网站编号(比如O1)
- echo 删除网站输入字母D+网站编号(比如D1)
- echo\&echo %Twice%
- echo %Back%
- set /p Choice_Next_1=
- set Choice_Next11=%Choice_Next_1:~0,1%
- set Choice_Next12=%Choice_Next_1:~1,1%
- if /i "!Choice_Next11!"=="d" call :DelW
- if /i "!Choice_Next11!"=="o" call :OpenWeb
- if /i "!Choice_Next11!"=="b" %Menu%
- endlocal&set Again=Choice3&goto Menu
- :Choice4
- if exist WebShell.txt del WebShell.txt
- cls&%Table%
- call :Echo
- echo 请输入想删除的类别编号:
- %Table%
- echo %Back%
- set /p Choice4_DT=
- if "%Choice4_DT%"=="b" %Menu%
- findstr /v !%Choice4_DT%! WebShell.ini>>WebShell.txt
- del WebShell.ini &ren "WebShell.txt" "WebShell.ini"
- echo 软件删除成功!&ping /n 3 127.1>nul
- %Table%
- echo %Back%
- %Table%
- echo %Twice%
- set /p Choice_DelT=
- if /i "!Choice_DelT!"=="b" %Menu%
- endlocal&set Again=Choice4&goto Menu
- :Echo
- %Table%
- for /l %%i in (1,1,%Type_1%) do set /p= ^(%%i^) !%%i!<nul&%Table%
- goto :eof
- :EchoWeb
- for /f "tokens=1,2,3,4* delims=+" %%j in ("%TypeName%") do (
- set Web_Desc=%%k&set Web_Name=%%l&set Web_PassWord=%%m&set Web_AddTime=%%n
- set /p= ^(%%i^) !Web_Desc! !Web_Name! !Web_Password! !Web_AddTime!<nul&echo\
- )
- goto :eof
- :OpenWeb
- for /l %%i in (1 1 %Choice_Num%) do (
- if "%%i"=="%Choice_Next12%" (
- call set Type_Name=!%Choice_3%!%%i
- call set TypeName=%%!Type_name!%%
- )
- )
- for /f "tokens=1,2,3* delims=+" %%i in ("%TypeName%") do start http://%%k
- goto :eof
- :DelW
- for /l %%i in (1 1 %Choice_Num%) do (
- if "%%i"=="%Choice_Next12%" (
- call set Type_Name=!%Choice_3%!%%i
- call set TypeName=%%!Type_name!%%
- )
- )
- findstr /v /c:"!TypeName!" WebShell.ini>>WebShell.txt
- del WebShell.ini&ren "WebShell.txt" "WebShell.ini"
- echo 网站删除成功!&ping /n 3 127.1>nul
- goto :eof
-
复制代码
|