cmd变量,参数,for循环,
@echo off
rem? *****************************************************
rem? Create By Q_rui CopryRight@_?? www.yoodo.com
rem? Mail:? rui.qin@yoodo.com
rem? Version V1.0 beat
rem? 2013-08-*
rem? Blog:? cnblogs.com/rui
rem? *****************************************************
::【Scripts aim function area】
echo Current time:? %date%,%time%
echo Current directory:? %cd%
echo Local host system type:? %OS%
echo "Current running filename:" %0
echo "this bat scripts first paramenters:" %1
::echo "this is scripts run result:" %!
::for /f %%i in (./websites.txt) do G:\monitor\curl -I %%i
if "%0" == "cmd.bat" type %0
::【Comment area】
::G:\monitor\curl --connect-timeout 12 --max-time 10 -o > nul -s -w %{http_code} http://192.168.1.109
echo "" >>nul
::linux and windows shell,bat傳參問題
::?? #linux sys
::?? #!/bin/sh
::?? 在linux系統中像如上指定$1要求傳參,但是當在執行時不加參時linux-shell事不會報錯及提示的,但是我們可以用腳本實現簡單的使用提示及幫助
::?? if [[ $# -eq 1 ]];
::???? echo "usage: sh $0 filename"
::?? fi
::?? file $1??? #查看由$1傳入的文件名及目錄等的參數,
::
::?? ::windows sys
::?? @echo off
::?? type %1
::?? if "%1"=="a" format a:
::?? if exist g:\monitor\monitors\bat\cmd.bat type
::?? bat和shell有太多的偶然性相似,bat程序運行結束會返回一個數值表示運行程序的運行結果,
pause
echo "Next see you,bye!"
pause
轉載于:https://www.cnblogs.com/ruiy/p/cmd.html
總結
以上是生活随笔為你收集整理的cmd变量,参数,for循环,的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Command_Of_Windows1
- 下一篇: 如何挑选基金经理 注意这几点就可以