中国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-09-15 12:59
47,812 topics / 349,917 posts / today 0 new / 48,268 members
DOS批处理 & 脚本技术(批处理室) » A boring piece of work (VBS) that can reverse file names
Printable Version  2,800 / 13
Floor1 jmz573515 Posted 2006-12-19 04:34
银牌会员 Posts 464 Credits 1,212
**Function: Reverse the filenames (including folders) in the current folder, keeping the extension unchanged, and the filename itself will not be reversed.
'Not guaranteed to be problem-free, use with caution! (Tested and passed on this machine)
on error resume next
set wshshell=createobject("wscript.shell")
set fso=createobject("scripting.filesystemobject")
set folder=fso.getfolder(WshShell.CurrentDirectory)
set files=folder.files
for each file in files
if file.name<>wscript.scriptname then
kzm=fso.GetExtensionName(file)
file.name=replace(file.name,"." & fso.GetExtensionName(file),"")
file.name=StrReverse(file.name) & "." & kzm
else
end if
next
set wjj=fso.getfolder(WshShell.CurrentDirectory)
set wjjs=wjj.subfolders
for each fd in wjjs
fd.name=StrReverse(fd.name)
next
msgbox "All filenames in the current folder have been reversed.",48+4096,"Prompt"

[ Last edited by jmz573515 on 2006-12-18 at 03:59 PM ]
Floor2 redtek Posted 2006-12-19 04:51
金牌会员 Posts 1,147 Credits 2,902
Appreciate~~~
It's really complicated~:)
Floor3 9527 Posted 2006-12-19 05:15
银牌会员 Posts 438 Credits 1,185 From 北京
Then I'll write a P-processing version by the way to reverse the filenames of all files in the current directory



[ Last edited by 9527 on 2006-12-19 at 05:28 AM ]
Floor4 ccwan Posted 2006-12-19 05:30
金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊
Brother 9527, why didn't I succeed? The original code has been updated ^_^

[ Last edited by ccwan on 2006-12-19 at 05:31 AM ]
Floor5 electronixtar Posted 2006-12-19 07:32
铂金会员 Posts 2,672 Credits 7,493
The key in VBS is
Floor6 wudixin96 Posted 2007-04-06 21:55
银牌会员 Posts 931 Credits 1,928
It's really thorough in the research. o(∩_∩)o... Haha. Learned it
Floor7 kich Posted 2007-04-07 05:01
中级用户 Posts 168 Credits 397
It's just that the StrReverse() function is at work!
Floor8 shaokui123 Posted 2008-02-23 23:16
初级用户 Posts 41 Credits 83
Can you reverse the files in a specified partition? How to restore?
Floor9 slore Posted 2008-02-23 23:41
铂金会员 Posts 2,478 Credits 5,212
Reply again, please~
Floor10 shaokui123 Posted 2008-02-24 18:13
初级用户 Posts 41 Credits 83
Please let an expert write one that reverses the files in a specified partition
Floor11 tireless Posted 2008-02-24 18:27
银牌会员 Posts 1,122 Credits 2,025
这是一句中文的文字游戏,正常翻译就是“Pig is the thought to come倒”,不过更准确的从文字颠倒的角度直译就是“倒过来念是猪”,即“The thought of the pig comes upside down” ,但更符合原文字游戏的直白翻译就是“Pig is the念来过倒”这样不太对,重新来:原句“猪是的念来过倒”正常按文字顺序颠倒后是“倒过来念是猪”,英文直白翻译就是“Inverted, it reads pig” ,不过更准确按照原句的字符顺序翻译就是“Pig is the 念来过倒”不对,重新整理:原句“猪是的念来过倒”,把每个字倒过来读就是“倒过来念是猪”,英文翻译为“When read upside down, it is pig”
Floor12 xmi Posted 2008-02-24 21:52
初级用户 Posts 56 Credits 125
It's tough, I'm just a newbie learning. Thanks
Floor13 shaokui123 Posted 2008-02-25 22:54
初级用户 Posts 41 Credits 83
Can the files in a specified partition be reversed?
Floor14 abcd Posted 2008-02-25 23:07
银牌会员 Posts 739 Credits 1,436
Originally posted by shaokui123 at 2008-2-25 10:54 PM:
Can you reverse the files in a specified partition?



Of course, make a slight modification. Or copy the file to the specified partition.

For recovery, please refer to the reply in floor 9
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023