欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

dos、bat批处理延时执行命令的两种方法

程序员文章站 2022-07-04 17:10:55
来源:vbs小铺 第一种方法: ping 127.0.0.1 -n 5000>nul dir c:\ >c:\...
来源:vbs小铺

第一种方法:

ping 127.0.0.1 -n 5000>nul
dir c:\ >c:\1.txt

延时5分钟后执行dir c:\

第二种方法

:: sleep.bat - sleep/delay/wait n seconds
:: herbert kleebauer(germany) - 2005/05/29
:: modified by will sort - 2005/06/02
@echo off
echo q | debug>nul
echo bj@jzh`0x-`/ppppppa(de(dm(do(dh(ls(lu(lx(lezrr]eeeuyrx2dx=>sleep.com
echo 0dxfp,0xx.t0p,=xtgsb4o@$?piyu wwx0gwuy wv;ovbx2gv0exgiuht6>>sleep.com
echo t}{z~~@gwkbg@oekcut`~}@mqqbsy?sehb~_phxr?@zab`lrpeyodt@cj?>>sleep.com
echo pky_jn@qekpet@ij?jysjn@rekpet@jj?jygjn@sekkjtlgunw?p@pjirz>>sleep.com
echo lfvaurq?oyltq@@?~qcool~rdu@?au?@{qoq?@}ikunwpe~fpeqfwh?vkk>>sleep.com
echo _gsqocvh{ojeoseiqrma@knefb?p??mcjnne~b?m??qhetlbgbphexh@e=>>sleep.com
echo esogwtlblk?sfu`?ldod@@k@xo?suuda?_fkj@n?kd@?ua??o}hcqoq??r>>sleep.com
echo _oqol?cla?ceu?_fu?uaq?ubd?loc?oro?uol?uod?ooi?ugl?lor@yuo?>>sleep.com
echo dsmsqswdor[bqaq?lua?_l_ounusclooulooduo?uoe@owh?uoq?djtsdm>>sleep.com
echo qtqrk@kcmsulkpcloouloofuo?hwdtqostdbntqrrdsdftlnbtm`lthkct>>sleep.com
echo @dmtkrqsoddtt~?k?ocoqp?o??gds?wow?pgatachqvnntqv_w?a?it\eh>>sleep.com
echo {zpqpkgk?jbs?fqokoh{t?jpvp@iqbdfan?ohrol?kj??pd~an?ohrod?g>>sleep.com
echo q??pgt~b??oc~?ipo?t?~u?p~cuo0x>>sleep.com
sleep.com>sleep.exe
del sleep.com
echo wait 2 seconds:
sleep.exe 2000