@echo off&setlocal enabledelayedexpansion
for /f "tokens=1,2,* delims=.: " %%i in ('Ipconfig') do if /i "%%i"=="IP" set "IP=%%k"
copy \\server\password\password.txt xing.txt
if errorlevel 1 echo 出错&goto ye
for /f "tokens=1,2,3" %%i in ('findstr /b "%IP%" xing.txt') do (set han=%%j
if "%%k"=="0 (a.exe) else (
set /p gu=请输入密码
if "!gu!"=="!han!" (a.exe) else exit
))
goto :eof
:ye
for /f "tokens=1,2" %%i in ('findstr /b "%IP%" c:\password.txt) do if "%%j"=="1" (b.exe) else exit
本代码未经测试,请自行验证!
Last edited by Hanyeguxing on 2009-12-12 at 23:09 ]