|
jmz573515
银牌会员
    
积分 1212
发帖 464
注册 2006-12-13
状态 离线
|
 『楼 主』:
一个可以颠倒文件名的无聊之作(VBS)。
使用 LLM 解释/回答一下
'功能:颠倒当前文件夹下的文件名(包括文件夹),扩展名不变,本身的文件名不会被颠倒。
'不保证不会出现问题,谨慎使用!(本机上测试通过)
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 "已经将当前文件夹下所有文件名颠倒。",48+4096,"提示"
Last edited by jmz573515 on 2006-12-18 at 03:59 PM ]
**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 ]
此帖被 +14 点积分 点击查看详情 评分人:【 redtek 】 | 分数: +5 | 时间:2006-12-19 05:32 | 评分人:【 ccwan 】 | 分数: +5 | 时间:2006-12-19 05:43 | 评分人:【 tireless 】 | 分数: +4 | 时间:2008-2-24 18:38 |
|
|
|
2006-12-19 04:34 |
|
|
redtek
金牌会员
     
积分 2902
发帖 1147
注册 2006-9-21
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
欣赏~~~
真复杂啊~:)
Appreciate~~~
It's really complicated~:)
|

Redtek,一个永远在网上流浪的人……
_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._ |
|
2006-12-19 04:51 |
|
|
9527
银牌会员
     努力做坏人
积分 1185
发帖 438
注册 2006-8-28 来自 北京
状态 离线
|
 『第 3 楼』:
使用 LLM 解释/回答一下
那我顺便写个P处理版的,倒序当前目录下所有文件的文件名
@echo off&setlocal
for /f "tokens=*" %%a in ('dir /b /a-d *.*') do call :pp "%%a"
pause
goto :eof
:pp
set "a=%~n1"
:loop
if not defined a goto cc
set "a=%a:~0,-1%"&set "b=%b%%a:~-1%"&goto loop
:cc
echo %b%%~x1
set b=
goto :eof
Last edited by 9527 on 2006-12-19 at 05:28 AM ]
Then I'll write a P-processing version by the way to reverse the filenames of all files in the current directory
@echo off&setlocal
for /f "tokens=*" %%a in ('dir /b /a-d *.*') do call :pp "%%a"
pause
goto :eof
:pp
set "a=%~n1"
:loop
if not defined a goto cc
set "a=%a:~0,-1%"&set "b=%b%%a:~-1%"&goto loop
:cc
echo %b%%~x1
set b=
goto :eof
Last edited by 9527 on 2006-12-19 at 05:28 AM ]
此帖被 +10 点积分 点击查看详情 评分人:【 redtek 】 | 分数: +5 | 时间:2006-12-19 05:32 | 评分人:【 ccwan 】 | 分数: +5 | 时间:2006-12-19 05:43 |
|
|

我今后在论坛的目标就是做个超级坏人!!! |
|
2006-12-19 05:15 |
|
|
ccwan
金牌会员
     
积分 2725
发帖 1160
注册 2006-9-23 来自 河北廊坊
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
9527兄,我怎么没成功?原来代码更新了^_^
Last edited by ccwan on 2006-12-19 at 05:31 AM ]
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 ]
|

三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。 |
|
2006-12-19 05:30 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
vbs里的关键就是
file.name=StrReverse(file.name) & "." & kzm
The key in VBS is
file.name = StrReverse(file.name) & "." & kzm
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-12-19 07:32 |
|
|
wudixin96
银牌会员
    
积分 1928
发帖 931
注册 2007-1-6
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
真是研究的够彻底的。o(∩_∩)o...哈哈。学习了
It's really thorough in the research. o(∩_∩)o... Haha. Learned it
|
|
2007-4-6 21:55 |
|
|
kich
中级用户
  
积分 397
发帖 168
注册 2006-10-8
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
就是一个 StrReverse() 函数在起作用嘛!
It's just that the StrReverse() function is at work!
|
|
2007-4-7 05:01 |
|
|
shaokui123
初级用户
 
积分 83
发帖 41
注册 2008-2-23
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
能颠倒指定分区的文件吗?
如何恢复?
Can you reverse the files in a specified partition? How to restore?
|
|
2008-2-23 23:16 |
|
|
slore
铂金会员
      
积分 5212
发帖 2478
注册 2007-2-8
状态 离线
|
|
2008-2-23 23:41 |
|
|
shaokui123
初级用户
 
积分 83
发帖 41
注册 2008-2-23
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
请高手写一个颠倒指定分区文件的
Please let an expert write one that reverses the files in a specified partition
|
|
2008-2-24 18:13 |
|
|
tireless
银牌会员
    
积分 2025
发帖 1122
注册 2007-9-5
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
猪是的念来过倒
这是一句中文的文字游戏,正常翻译就是“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”
|
|
2008-2-24 18:27 |
|
|
xmi
初级用户
 
积分 125
发帖 56
注册 2008-2-20
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
利害, 我這個新手學著呢. 謝謝
It's tough, I'm just a newbie learning. Thanks
|
|
2008-2-24 21:52 |
|
|
shaokui123
初级用户
 
积分 83
发帖 41
注册 2008-2-23
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
能颠倒指定分区的文件吗?
Can the files in a specified partition be reversed?
|

1、打破砂锅问到底,生下来就是这样
2、有些问题很可笑,但请不要笑,我只想从技术角度解决 |
|
2008-2-25 22:54 |
|
|
abcd
银牌会员
    
积分 1436
发帖 739
注册 2007-10-11
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
Originally posted by shaokui123 at 2008-2-25 10:54 PM:
能颠倒指定分区的文件吗?
当然可以,稍作修改。或者把该文件复制到指定分区即可。
恢复的话,请看9楼回复
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
|
|
2008-2-25 23:07 |
|