中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-01 12:46
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » <<>>如何判断日期自动生成新批处理文件?? 查看 3,859 回复 22
16 发表于 2005-03-07 00:00 ·  中国 湖南 长沙 电信
高级用户
★★
积分 772
发帖 273
注册 2004-10-23 00:00
21年会员
UID 32861
性别 男
状态 离线
不存在的我都测试过了批处理结束就会释放内存的
http://www.msfans.net/bbs/
17 发表于 2005-03-09 00:00 ·  中国 福建 三明 电信
中级用户
★★
积分 316
发帖 83
注册 2005-03-01 00:00
21年会员
UID 36626
性别 男
状态 离线
楼上的兄弟确实有的:d:&gt;set /a d=08-1
无效数字。数字常数只能是十进制(17),十六位进制(0x11)或八进制(021)。set /a d=09-1也是
18 发表于 2005-03-09 00:00 ·  中国 福建 三明 电信
中级用户
★★
积分 316
发帖 83
注册 2005-03-01 00:00
21年会员
UID 36626
性别 男
状态 离线
我用的系统是win2000
19 发表于 2005-03-09 00:00 ·  中国 湖南 长沙 电信
高级用户
★★
积分 772
发帖 273
注册 2004-10-23 00:00
21年会员
UID 32861
性别 男
状态 离线
那也很容易解决只需要在每个月份的标号如:01下接一个命令set %b%=1就行了修改如下:for /f "tokens=1,2,3 delims=- " %%a in ('date /t' do set a=%%c
for /f "tokens=1,2,3 delims=- " %%a in ('date /t' do set b=%%b
for /f "tokens=1,2,3 delims=- " %%a in ('date /t' do set c=%%a
for %%a in (01 02 03 04 05 06 07 08 09 10 11 12) do if %b%==%%a goto %%a:01
for %%a in (01 06 11 16 21 26 31) do if %a%==%%a goto next1
goto end:next1
set /a d=%b%+11
set /a e=%b%+10
set /a n=%c%-1
set name=%n%%d%to%n%%e%
if %c%==2005 set c=05
set /a n=%c%-1
echo atx.exe %name%&gt;b.bat
echo ren atx1.txt 0%n%%d%to0%n%%e%atx.txt&gt;&gt;b.bat
goto end:02
for %%a in (01 06 11 16 21 26 28) do if %a%==%%a goto next2
goto end:next2
set /a d=%b%+10
set /a e=%b%+9
set /a n=%c%-1
set name=%n%%d%to%n%%e%
if %c%==2005 set c=05
set /a n=%c%-1
echo atx.exe %name%&gt;b.bat
echo ren atx1.txt 0%n%%d%to0%n%%e%atx.txt&gt;&gt;b.bat&gt;&gt;b.bat
goto end:03
for %%a in (01 06 11 16 21 26 31) do if %a%==%%a goto next3
goto end:next3
set /a d=%b%-2
set /a e=%b%-1
set name=%c%0%d%to%c%0%e%
echo atx.exe %name%&gt;b.bat
if %c%==2005 set c=05
set name=%c%0%d%to%c%0%e%
echo ren atx1.txt %name%atx.txt&gt;&gt;b.bat
goto end:04
for %%a in (01 06 11 16 21 26 30) do if %a%==%%a goto next4
goto end:next4
set /a d=%b%-2
set /a e=%b%-1
if %c%==2005 set c=05
set name=%c%0%d%to%c%0%e%
echo atx.exe %name%&gt;b.bat
set name=%c%0%d%to%c%0%e%
echo ren atx1.txt %name%atx.txt&gt;&gt;b.bat
goto end:05
for %%a in (01 06 11 16 21 26 31) do if %a%==%%a goto next5
goto end:next5
set /a d=%b%-2
set /a e=%b%-1
if %c%==2005 set c=05
set name=%c%0%d%to%c%0%e%
echo atx.exe %name%&gt;b.bat
set name=%c%0%d%to%c%0%e%
echo ren atx1.txt %name%atx.txt&gt;&gt;b.bat
goto end:06
for %%a in (01 06 11 16 21 26 30) do if %a%==%%a goto next6
goto end:next6
set /a d=%b%-2
set /a e=%b%-1
if %c%==2005 set c=05
set name=%c%0%d%to%c%0%e%
echo atx.exe %name%&gt;b.bat
set name=%c%0%d%to%c%0%e%
echo ren atx1.txt %name%atx.txt&gt;&gt;b.bat
goto end:07
for %%a in (01 06 11 16 21 26 31) do if %a%==%%a goto next7
goto end:next7
set /a d=%b%-2
set /a e=%b%-1
if %c%==2005 set c=05
set name=%c%0%d%to%c%0%e%
echo atx.exe %name%&gt;b.bat
set name=%c%0%d%to%c%0%e%
echo ren atx1.txt %name%atx.txt&gt;&gt;b.bat
goto end:08
set %b%=8
for %%a in (01 06 11 16 21 26 31) do if %a%==%%a goto next8
goto end:next8
set /a d=%b%-2
set /a e=%b%-1
if %c%==2005 set c=05
set name=%c%0%d%to%c%0%e%
echo atx.exe %name%&gt;b.bat
set name=%c%0%d%to%c%0%e%
echo ren atx1.txt %name%atx.txt&gt;&gt;b.bat
goto end:09
set %b%=9
for %%a in (01 06 11 16 21 26 30) do if %a%==%%a goto next9
goto end:next9
set /a d=%b%-2
set /a e=%b%-1
if %c%==2005 set c=05
set name=%c%0%d%to%c%0%e%
echo atx.exe %name%&gt;b.bat
set name=%c%0%d%to%c%0%e%
echo ren atx1.txt %name%atx.txt&gt;&gt;b.bat
goto end:10
for %%a in (01 06 11 16 21 26 31) do if %a%==%%a goto next10
goto end:next10
set /a d=%b%-2
set /a e=%b%-1
if %c%==2005 set c=05
set name=%c%0%d%to%c%0%e%
echo atx.exe %name%&gt;b.bat
set name=%c%0%d%to%c%0%e%
echo ren atx1.txt %name%atx.txt&gt;&gt;b.bat
goto end:11
for %%a in (01 06 11 16 21 26 30) do if %a%==%%a goto next11
goto end:next11
set /a d=%b%-2
set /a e=%b%-1
if %c%==2005 set c=05
set name=%c%0%d%to%c%%e%
echo atx.exe %name%&gt;b.bat
set name=%c%0%d%to%c%0%e%
echo ren atx1.txt %name%atx.txt&gt;&gt;b.bat
goto end:12
for %%a in (01 06 11 16 21 26 31) do if %a%==%%a goto next12
goto end:next12
set /a d=%b%-2
set /a e=%b%-1
if %c%==2005 set c=05
set name=%c%%d%to%c%%e%
echo atx.exe %name%&gt;b.bat
set name=%c%0%d%to%c%0%e%
echo ren atx1.txt %name%atx.txt&gt;&gt;b.bat
goto end:end
http://www.msfans.net/bbs/
20 发表于 2005-03-09 00:00 ·  中国 广东 珠海 电信
初级用户
积分 138
发帖 13
注册 2005-03-03 00:00
21年会员
UID 36693
性别 男
状态 离线
哈哈,我在你回复前,已修改了,谢谢chenhui530 ,非常感激。。我已将程序发扬光大了。。
21 发表于 2005-03-10 00:00 ·  中国 湖南 长沙 电信
高级用户
★★
积分 772
发帖 273
注册 2004-10-23 00:00
21年会员
UID 32861
性别 男
状态 离线
呵呵不知道楼主用这个批处理作什么用啊?
http://www.msfans.net/bbs/
22 发表于 2005-03-11 00:00 ·  中国 福建 三明 电信
中级用户
★★
积分 316
发帖 83
注册 2005-03-01 00:00
21年会员
UID 36626
性别 男
状态 离线
chenhui530大侠 是不是只有08-1 09-1 不能通过其他的好像都不会提示出错
23 发表于 2005-03-11 00:00 ·  中国 湖南 长沙 电信
高级用户
★★
积分 772
发帖 273
注册 2004-10-23 00:00
21年会员
UID 32861
性别 男
状态 离线
以下是引用smileseeker在2005-3-11 11:00:43的发言:

chenhui530大侠 是不是只有08-1 09-1 不能通过
其他的好像都不会提示出错


是的啊
我也不知道是为什么
http://www.msfans.net/bbs/
论坛跳转: