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-09-25 01:05
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » (Help) How to write a .bat file to implement file renaming batch processing View 3,175 Replies 18
Floor 16 Posted 2007-04-02 22:50 ·  德国
初级用户
Credits 36
Posts 14
Joined 2007-03-31 17:31
19-year member
UID 83522
Gender Male
Status Offline
It's my own unfamiliarity with grammar, there was an input error, the test was all successful, thank you everyone. But everyone can also post new methods for comparison if there are any.
Thank you

[ Last edited by tommy725 on 2007-4-2 at 09:52 AM ]
Floor 17 Posted 2007-04-13 09:06 ·  中国 江苏 苏州 电信
中级用户
★★
Credits 238
Posts 98
Joined 2007-04-10 07:50
19-year member
UID 84593
Gender Male
From 陕西
Status Offline
It seems there is no specified path. Can we specify a path? Otherwise, how do we know which paths the renaming will be applied to?
一切皆有可能!我行!我能!
Floor 18 Posted 2007-04-13 14:07 ·  中国 湖北 武汉 电信
初级用户
Credits 68
Posts 30
Joined 2007-01-16 07:05
19-year member
UID 76659
Gender Male
Status Offline
set str=!str: =-!

Can you explain what this sentence means?

Thanks!
Floor 19 Posted 2007-04-13 21:25 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 2,000
Posts 621
Joined 2007-01-01 00:00
19-year member
UID 75212
Gender Male
Status Offline
set str=%str: =-%

This is to replace spaces in the environment variable str with -.

For example
set p=14+58+96
set p=%p:+=-%

Then after execution, %p% is 14-58-96
Forum Jump: