日常桌面維護工作中,管理者常常需要使用者提供IP/主機名/登陸賬戶等資訊。但大多數使用者對于查詢IP等資訊并不是很了解,經常管理者給解釋了半天,使用者還是雲裡霧裡的弄不明白,是以從網上扒拉了一些資料做了這個腳本友善日常使用。
主要功能:
輕按兩下此腳本後以彈窗的形式顯示目前系統的主機名、登陸使用者名、IP資訊等内容,如下圖:
<a href="http://blog.51cto.com/attachment/201303/165547192.png" target="_blank"></a>
@echo off
rem 隐藏啟動批處理運作過程中的黑框
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin
echo 目前主機名是: > ipinfo.txt
hostname >> ipinfo.txt
echo 目前登陸賬戶: >> ipinfo.txt
echo %username% >>ipinfo.txt
echo 目前IP位址是: >> ipinfo.txt
ipconfig | find /i "ip" >> ipinfo.txt
echo 目前的DNS是: >>ipinfo.txt
ipconfig /all | find /i "dns" >>ipinfo.txt
msg %username% /W /time:3600 < ipinfo.txt
del /q ipinfo.txt
exit
本文轉自 yab109 51CTO部落格,原文連結:http://blog.51cto.com/active/1151913,如需轉載請自行聯系原作者