China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-12 13:33
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How can I make a batch file run automatically at a specified time? View 1,035 Replies 4
Original Poster Posted 2010-03-23 10:29 ·  中国 吉林 长春 电信
初级用户
Credits 69
Posts 46
Joined 2010-03-18 11:14
16-year member
UID 162446
Gender Male
From 山东
Status Offline
I want a batch file to run automatically at a specified time every day. How do I do that? Can a batch file get the system time?
Floor 2 Posted 2010-03-23 11:57 ·  美国 惠普HP
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Floor 3 Posted 2010-03-23 12:08 ·  中国 陕西 咸阳 电信
初级用户
★★
Credits 128
Posts 122
Joined 2009-09-21 06:24
16-year member
UID 152378
Gender Male
Status Offline
Scheduled Tasks
Floor 4 Posted 2010-03-23 17:05 ·  中国 福建 三明 电信
高级用户
★★
论坛上抢劫的
Credits 551
Posts 246
Joined 2006-09-21 12:35
19-year member
UID 63270
Status Offline
Floor 5 Posted 2010-03-26 00:05 ·  中国 江苏 南京 鼓楼区 电信
新手上路
Credits 2
Posts 2
Joined 2010-02-18 21:16
16-year member
UID 160805
Gender Male
Status Offline
To make a batch file run automatically at a specified time every day, you just need to write the at command into the batch file. If you want to get the system time, use %date% and %time%

@echo off
at 16:00 /every:m,t,w,th,f,s,su net share a=c:
pause

The code above opens sharing every day at 4 PM.

@echo off
echo %date%
echo %time%
pause
Forum Jump: