ipc$开启telnet

@echo off
title opentelnet      cheng...
MODE con: COLS=44 LINES=15
:zjm
cls
color 0a
for /l %%i in (1,1,5) do echo.
echo                    -简介-
echo.
echo              依靠ipc$来开启Telnet!
echo          请按提示输入...
echo.
set/p ip= 输入IP:
if /i "%ip%"=="q" exit
set/p user= 用户名:
if /i "%user%"=="q" exit
set/p password= 密  码:
if /i "%password%"=="q" exit
echo.
echo  正在建立ipc$连接...
net use \\%ip%\ipc$ "%password%" /user:%user%
IF ERRORLEVEL 1 goto error
IF ERRORLEVEL 0 goto ipc$ok
:error
color 0c
echo ipc$连接失败!请查看错误提示!按任意键返回...
pause>nul & goto zjm
:ipc$ok
cls
color 0a
echo.
echo.
ping 127.1 -n 1 >nul 2>nul
echo ipc$连接成功!
ping 127.1 -n 1 >nul 2>nul
echo 正在开启Telnet..
ping 127.1 -n 1 >nul 2>nul
sc \\%ip% config TlntSvr start= demand >nul 2>nul
sc \\%ip% start TlntSvr >nul 2>nul
ping 127.1 -n 1 >nul 2>nul
echo Telnet成功开启!!!
ping 127.1 -n 1 >nul 2>nul
echo 删除ipc$连接关系...
ping 127.1 -n 1 >nul 2>nul
echo.
net use \\%ip%\ipc$ /del /y
ping 127.1 -n 1 >nul 2>nul
echo.
echo         是否登陆 %ip% 呢?
echo               y:是    n:否
echo.
set/p shr= 请选择:
if /i "%shr%"=="y" goto lj
if /i "%shr%"=="n" goto qx
IF ERRORLEVEL 1 goto cw
:cw
cls

批处理文件,可以很成功的开启telnet。

你可能感兴趣的:(telnet)