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-02 15:29
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Experts, please come in! View 746 Replies 4
Original Poster Posted 2006-12-04 22:43 ·  中国 广西 贵港 电信
初级用户
Credits 23
Posts 10
Joined 2006-12-04 22:13
19-year member
UID 72565
Gender Male
Status Offline
Floor 2 Posted 2006-12-04 23:53 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
1:
@echo off
set /p 路径=Please enter the path where you want to create the files 01.txt_99.txt
for /l %%a in (1 1 99) do (set c=0%%a
set c=!c:~-2!
cd.>%路径%\!c!.txt)

2:
@echo off
FOR /F "tokens=*" %%a in ('dir/s/b *.bat') do "%%a"
Floor 3 Posted 2006-12-05 00:12 ·  中国 江苏 苏州 中移铁通
初级用户
★★
Credits 144
Posts 66
Joined 2006-11-30 00:37
19-year member
UID 72121
Gender Male
Status Offline
Floor 4 Posted 2006-12-05 00:51 ·  中国 北京 东城区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Moderator, the line set c=!c:~-2! is both elegant and a shortcut~~
First “pad” with 0, then remove the extra 0 on the left. Nice!
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 5 Posted 2006-12-05 01:54 ·  中国 江苏 苏州 中移铁通
初级用户
★★
Credits 144
Posts 66
Joined 2006-11-30 00:37
19-year member
UID 72121
Gender Male
Status Offline
Can some expert explain it??? My question above????
Forum Jump: