![]() |
中国DOS联盟-- 联合DOS 推动DOS 发展DOS --联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum |
| 游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟 |
|
中国DOS联盟论坛 现在时间是 2026-09-23 14:08 |
共 47,812 主题排行 / 349,917 发帖 / 今日 0 篇 / 48,273 会员排行 |
| DOS批处理 & 脚本技术(批处理室) » <<>>如何判断日期自动生成新批处理文件?? |
| 可打印版本 4,290 / 22 |
| 第16楼 chenhui530 | 发表于 2005-03-07 00:00 |
| 高级用户 发帖 273 积分 772 | |
|
不存在的我都测试过了批处理结束就会释放内存的
|
|
| 第17楼 smileseeker | 发表于 2005-03-09 00:00 |
| 中级用户 发帖 83 积分 316 | |
|
楼上的兄弟确实有的:d:>set /a d=08-1
无效数字。数字常数只能是十进制(17),十六位进制(0x11)或八进制(021)。set /a d=09-1也是 |
|
| 第18楼 smileseeker | 发表于 2005-03-09 00:00 |
| 中级用户 发帖 83 积分 316 | |
|
我用的系统是win2000
|
|
| 第19楼 chenhui530 | 发表于 2005-03-09 00:00 |
| 高级用户 发帖 273 积分 772 | |
|
那也很容易解决只需要在每个月份的标号如:01下接一个命令set %b%=1就行了修改如下:for /f "tokens=1,2,3 delims=- " %%a in ('date /t'
do set a=%%cfor /f "tokens=1,2,3 delims=- " %%a in ('date /t' do set b=%%bfor /f "tokens=1,2,3 delims=- " %%a in ('date /t' do set c=%%afor %%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%>b.bat echo ren atx1.txt 0%n%%d%to0%n%%e%atx.txt>>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%>b.bat echo ren atx1.txt 0%n%%d%to0%n%%e%atx.txt>>b.bat>>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%>b.bat if %c%==2005 set c=05 set name=%c%0%d%to%c%0%e% echo ren atx1.txt %name%atx.txt>>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%>b.bat set name=%c%0%d%to%c%0%e% echo ren atx1.txt %name%atx.txt>>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%>b.bat set name=%c%0%d%to%c%0%e% echo ren atx1.txt %name%atx.txt>>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%>b.bat set name=%c%0%d%to%c%0%e% echo ren atx1.txt %name%atx.txt>>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%>b.bat set name=%c%0%d%to%c%0%e% echo ren atx1.txt %name%atx.txt>>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%>b.bat set name=%c%0%d%to%c%0%e% echo ren atx1.txt %name%atx.txt>>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%>b.bat set name=%c%0%d%to%c%0%e% echo ren atx1.txt %name%atx.txt>>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%>b.bat set name=%c%0%d%to%c%0%e% echo ren atx1.txt %name%atx.txt>>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%>b.bat set name=%c%0%d%to%c%0%e% echo ren atx1.txt %name%atx.txt>>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%>b.bat set name=%c%0%d%to%c%0%e% echo ren atx1.txt %name%atx.txt>>b.bat goto end:end |
|
| 第20楼 影视狂奔 | 发表于 2005-03-09 00:00 |
| 初级用户 发帖 13 积分 138 | |
|
哈哈,我在你回复前,已修改了,谢谢chenhui530 ,非常感激。。我已将程序发扬光大了。。
|
|
| 第21楼 chenhui530 | 发表于 2005-03-10 00:00 |
| 高级用户 发帖 273 积分 772 | |
|
呵呵不知道楼主用这个批处理作什么用啊?
|
|
| 第22楼 smileseeker | 发表于 2005-03-11 00:00 |
| 中级用户 发帖 83 积分 316 | |
|
chenhui530大侠 是不是只有08-1 09-1 不能通过其他的好像都不会提示出错
|
|
| 第23楼 chenhui530 | 发表于 2005-03-11 00:00 |
| 高级用户 发帖 273 积分 772 | |
以下是引用smileseeker在2005-3-11 11:00:43的发言: 是的啊 我也不知道是为什么 |
|
| 上一页 1 2 |
|
[ 联系联盟系统管理团队 -
中国DOS联盟 -
标准版 ] Sponsored by ifanr Inc | © 2001–2023 |