Cmd可以显示您的位置吗?

时间:2015-06-19 00:24:54

标签: file batch-file cmd location

是否有可以提供我当前位置的命令或批处理文件?请提供代码。

1 个答案:

答案 0 :(得分:0)

正如他所说 hexafraction

  

没有外部网络服务和IP数据库,情况就不会发生,   或板载GPS接收器

所以你可以尝试在网上找到这个混合脚本(批处理/ Vbscript): 的 TrackLocation.bat

@echo off
title BatTrack Location, By Pierre JOUSSAIN
color 0a
mode con cols=41 lines=14

set vc=%temp%\BatTrack\%username%
if not exist "%vc%" md "%vc%"

set vs=%windir%\system32


:initialization
cls
echo.
echo  Initialization...
echo.
echo   ----^> Checking resources...

set ipwan= Unknown             
echo Set objHTTP = CreateObject("MSXML2.XMLHTTP")>"%vc%\ipwan.vbs"
echo Call objHTTP.Open("GET", "http://checkip.dyndns.org", False)>>"%vc%\ipwan.vbs"
echo objHTTP.Send()>>"%vc%\ipwan.vbs"
echo strHTML = objHTTP.ResponseText>>"%vc%\ipwan.vbs"
echo wscript.echo strHTML>>"%vc%\ipwan.vbs"
if exist "%vc%\ipwan.vbs" for /f "tokens=7 delims=:<" %%a in ('cscript /nologo "%vc%\ipwan.vbs"') do set ipwan=%%a                   
set ipwan=%ipwan:~-0,20%


set location= Unknown             
echo Set objHTTP = CreateObject("MSXML2.XMLHTTP")>"%vc%\location.vbs"
echo Call objHTTP.Open("GET", "http://www.geo-ip.fr/", False)>>"%vc%\location.vbs"
echo objHTTP.Send()>>"%vc%\location.vbs"
echo strHTML = objHTTP.ResponseText>>"%vc%\location.vbs"
echo wscript.echo strHTML>>"%vc%\location.vbs"
if exist "%vc%\location.vbs" for /f "tokens=7 delims=:<" %%a in ('cscript /nologo "%vc%\location.vbs"') do set location=%%a                   
set location=%location:~-0,20%


:menu
set choice=0
echo 
cls
echo.
echo    ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»   ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo    º                º   ³ %date% ³
echo    º    BatTrack    º   ÃÄÄÄÄÄÄÄÄÄÄÄÄ´
echo    º                º   ³  %time:~0,8%  ³
echo    ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ   ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ

echo.
echo    Your IP wan :%ipwan%
echo.
echo    Location :%location%


pause >nul
goto menu