中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-11-11 07:23
47,815 topics / 349,930 posts / today 0 new / 48,291 members
DOS批处理 & 脚本技术(批处理室) » Please help the experts to modify this batch processing about time
Printable Version  4,427 / 26
Floor16 lxmxn Posted 2006-10-28 09:05
版主 Posts 4,938 Credits 11,386


  • From the content written in the code, the first 1 represents hours and the second 1 represents minutes.

  • To run the file at a specified time, you can consider the at command and the schtasks command. You can also use this batch script, just modify the code.

  • As for this "schtasks /delete /tn "zhang" /f", it means to delete the scheduled task with the task name "zhang".
Floor17 78586862 Posted 2006-10-28 23:25
初级用户 Posts 14 Credits 25
I followed the above and tried it. I can already create tasks, but they can't run. Then I created a task myself and it prompted:

A new task has been created, but it may not run because account information cannot be set.
The specified error is:
0x80070005: Access is denied
Please try using the "Task" browse button to locate the application

The user I'm currently using is Administrator, which is a super user. Why can't I create tasks?
Floor18 不得不爱 Posted 2006-10-28 23:27
超级版主 Posts 2,044 Credits 5,310 From 四川南充
Maybe some service is forbidden
Floor19 78586862 Posted 2006-10-28 23:38
初级用户 Posts 14 Credits 25
Enter gpedit.msc to bring up the Group Policy. Then, successively click "Computer Configuration" - "Windows Settings" - "Security Settings" - "Local Policies" - "Security Options". In the right - hand box, change "Accounts: Limit local accounts that have blank passwords to console logon only" to "Disabled", and it should be okay.
Floor20 zerocq Posted 2006-10-28 23:44
中级用户 Posts 196 Credits 458
Using VBScript's DateAdd() is simpler for MS...
Floor21 luobotou Posted 2007-01-04 03:53
新手上路 Posts 7 Credits 16 From 河南省南阳市
No reply to post 13?
Are %next_hour% and !next_hour! the same?
Floor22 rochan Posted 2007-01-04 04:49
初级用户 Posts 14 Credits 40
The avatar of "Must Love" is really ugly.....

Forgive me for speaking frankly!
Floor23 qq82015930 Posted 2007-12-09 12:37
中级用户 Posts 109 Credits 235
Please provide the specific content that needs to be translated. You only provided "看了总要留句话在走", please clarify the full context so that I can accurately translate it.
Floor24 huahua0919 Posted 2007-12-09 13:22
银牌会员 Posts 780 Credits 1,608
Originally posted by luobotou at 2007-1-4 03:53 AM:
No reply to post 13?
Are %next_hour% and !next_hour! the same?


Variable delay
Different effects!
Floor25 nanhui112 Posted 2007-12-12 22:18
初级用户 Posts 59 Credits 127
Hehe In the past, I encountered the same problem regarding time. I'll also leave a message. Up~~~
Floor26 ooaf Posted 2007-12-26 18:32
中级用户 Posts 162 Credits 313
To achieve running d.bat at intervals of seconds, is the following correct, calculation of seconds?

Run d.bat every 10s, and re-add the task, loop

setlocal ENABLEDELAYEDEXPANSION
at /delete /yes
rem Here 10 is the interval time (s), you can adjust it yourself as needed
set/a next_hour=%time:~0,2%
set/a next_minute=1%time:~3,2%-100
set/a next_second=1%time:~6,2%-100+10
if %next_second% GEQ 60 (set /a next_second=!next_second!-60
set /a next_minute=!next_minute!+1
if %next_minute% GEQ 60 (set /a next_minute=!next_minute!-60
set /a next_hour=!next_hour!+1
if !next_hour! GEQ 24 set /a next_hour=!next_hour!-24)
)
at !next_hour!:!next_minute!:!next_second! d:\d.bat
endlocal

Save as d.bat

[ Last edited by ooaf on 2007-12-26 at 06:36 PM ]
Floor27 yushe Posted 2007-12-31 14:50
新手上路 Posts 6 Credits 12
Learning
Prev  1 2
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023