Originally posted by willsort at 2005-10-28 10:53:
Re dosfroum:
:: GetCard.cmd - Get "Description" of net card that IP address is "192.168.*.*"
:: Will Sort - 2005-10-28 - CMD@WinXP
@echo off
setlocal EnableDelayedExpansion
for /f "delims=" %%s in ('ipconfig /all') do (
set line=%%s
echo.!line! | findstr "Description" >nul && set CardName=!line:~44!
echo.!CardName! | findstr /r "\<#" >nul && set CardName=!CardName:~0,-3!
echo.!line! | findstr "192.168." >nul && goto EchoName
)
:EchoName
echo CardName="%CardName%"
在这个批处理中。!这个感叹号在这里代表着什么作用
findstr /r "\<#" 中的 "\<#" 是什么意思
for /f "tokens=1 delims= " %f in ('tasklist ^| findstr /i "winword.exe"') do echo ..........
('tasklist ^| findstr /i "winword.exe"') 为什么这里需要这个 “^” 才可以运行这个命令,而身上面的那些命令中并不需要
还有 "tokens= delims= " 跟 "delims= tokens= "有什么区别。前后不同的作用是什么
Last edited by zreo on 2005-11-24 at 22:20 ]