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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值