批处理打造绿色方便的个性化Tor!
首次启动的界面
程序已经启动的提示界面
代码如下: @echo off
set mypath=�%
:privoxy
call :check Privoxy vidalia
:vidalia
call :check vidalia end
:end
ping 127.0.0.1 -n 2 >nul
exit
:check
for /f "tokens=1 delims= " %%i in ('tasklist /fi "imagename eq %1.exe"^|find /i "%1.exe"') do set mytmp=%%i
if "%mytmp%"=="" (
echo 正在启动进程%1.exe!
cd /d "%mypath%\%1"
start "%1" /min "%1.exe"
) else (
echo %1.exe进程已经启动!
goto %2 )
这批处理自动判断程序是否已经启动,防止重复启动程序.
有了能控制启动的,自然就想到控制停止的批处理:
程序已经启动的提示界面
代码如下: @echo off
set mypath=�%
:privoxy
call :check Privoxy vidalia
:vidalia
call :check vidalia end
:end
ping 127.0.0.1 -n 2 >nul
exit
:check
for /f "tokens=1 delims= " %%i in ('tasklist /fi "imagename eq %1.exe"^|find /i "%1.exe"') do set mytmp=%%i
if "%mytmp%"=="" (
echo 正在启动进程%1.exe!
cd /d "%mypath%\%1"
start "%1" /min "%1.exe"
) else (
echo %1.exe进程已经启动!
goto %2 )
call :kill tor vidalia
:vidalia
call :kill vidalia privoxy
:privoxy
call :kill privoxy end
:end
call "�%\Del_IE_proxy.bat"
ping 127.0.0.1 -n 2 >nul
exit
:kill
for /f "tokens=1 delims= " %%i in ('tasklist /fi "imagename eq %1.exe"^|find /i "%1.exe"') do set mytmp=%%i
if "%mytmp%"=="" (
echo 没有运行进程%1.exe!
) else (
echo 正在关闭进程%1.exe
taskkill /f /fi "imagename eq %mytmp%"
goto :%2
)
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "127.0.0.1:8118" /t REG_SZ /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /d 1 /t REG_DWORD /f
echo 修改完成,重启IE生效!
echo 请登陆https://check.torproject.org/验证!
pause
@echo off
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "" /t REG_SZ /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /d 0 /t REG_DWORD /f
ping 127.1 -n 3 >nul
效果如下:
为方便大家使用,我打包放到Rayfile中,方便下载,下载地址如下: http://www.rayfile.com/files/a979eeb3-0801-11de-ac1c-0019d11a795f/