|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第 16 楼』:
使用 LLM 解释/回答一下
无奈何版主:
之前关于我不能使用添加到收藏夹的原因,我测试下来发现,原从注册表中获取“收藏”文件夹路径那段代码,不能获取Favorites变量,而下面一段代码却不能获得全部路径,我能力有限,请无奈何版主看看还有更好的代码
@echo off
set reg="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
for /f "skip=2 tokens=1,* delims=:" %%i in ('reg query %reg% /v "Favorites"') do set Favorites=%%j
echo %Favorites%
echo.
pause
Helpless Moderator:
The reason why I couldn't use the "Add to Favorites" before, after my test, I found that the original code to get the "Favorites" folder path from the registry can't get the Favorites variable, and the following code can't get the full path. I'm limited in ability, please, Helpless Moderator, take a look and see if there's a better code
@echo off
set reg="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
for /f "skip=2 tokens=1,* delims=:" %%i in ('reg query %reg% /v "Favorites"') do set Favorites=%%j
echo %Favorites%
echo.
pause
|

第一高手 第二高手
我的小站
 |
|
2006-10-3 08:03 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
|
2006-10-3 08:50 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 18 楼』:
使用 LLM 解释/回答一下
又想到了几个实用功能:
1.用fsutil清零文件、文件夹。实在不行用 copy nul 也行
2.转换文档类型,例如论坛老贴里很多vbs脚本 doc2htm htm2txt any2bat bat2exe
3.脚本加密,包括bat的unicode加密,js/vbs的encoder加密和frustrator加密
4.GB2312和UTF-8之间的互相转换,全角/半角的互相转换,GBK、繁体之间的转换,网上有html版的,做成vbs版应该不难
5.英文txt的大小写转换
6.批处理的查看NFO
7.bat js vbs转exe的实用工具,只要安装了 .NET Framework 就可以用vbs实现
9. Google文件名,对于不熟悉的系统文件名很有用,甚至做一个查找文件名后缀的东东,呵呵
10.获得文件的MD5 CRC32 hash值,呵呵,需要第三方软件支持。其实大家想想,这个功能放到“发送到”很实用的,因为平时我们做文件校检都是 打开 winmd5sum.exe,拖放文件,copy所得计算值,这样做久了很烦啊
11.简陋的合并文件功能 copy /b +
12.有可能的话,结合 memcoder和LAME做编码/解码快捷方式
13.Office文档的转换,用 ADODB 做 xls2txt ,即使没有安装excel也可以打开xls文件
14.结合简单的shell技术做文件夹的explorer级别的加密,比如大家熟悉的把一个文件夹伪装成回收站
15.有兴趣的话再做一个 FTP 上传、映射网络驱动器,subst虚拟磁盘,mountdrv fsutil HardLink的快捷方式,^_^
16.我会考虑用WIA做一个转换图片格式的,用TTS做一个文本到语音的转换脚本
其实Windows自带的很多exe还有更加广泛的引用,只要大家思路开阔,没有什么不可以~~
Last edited by electronixtar on 2006-10-3 at 10:24 ]
Thought: 用户现在需要将这段中文内容准确翻译成英文,需要注意保留格式和专业术语的正确翻译。
Step 1: 逐句翻译。
“又想到了几个实用功能:”翻译为“Several more practical functions occurred to me:”
“1.用fsutil清零文件、文件夹。实在不行用 copy nul 也行”翻译为“1. Use fsutil to clear files and folders. If not, using copy nul is also okay”
“2.转换文档类型,例如论坛老贴里很多vbs脚本 doc2htm htm2txt any2bat bat2exe”翻译为“2. Convert document types, for example, there are many vbs scripts in old forum posts, like doc2htm, htm2txt, any2bat, bat2exe”
“3.脚本加密,包括bat的unicode加密,js/vbs的encoder加密和frustrator加密”翻译为“3. Script encryption, including bat's Unicode encryption, js/vbs's encoder encryption, and frustrator encryption”
“4.GB2312和UTF-8之间的互相转换,全角/半角的互相转换,GBK、繁体之间的转换,网上有html版的,做成vbs版应该不难”翻译为“4. Conversion between GB2312 and UTF-8, conversion between full-width/half-width, conversion between GBK and traditional Chinese. There are HTML versions online, and it shouldn't be difficult to make a VBS version”
“5.英文txt的大小写转换”翻译为“5. Conversion of uppercase and lowercase in English txt”
“6.批处理的查看NFO”翻译为“6. View NFO in batch processing”
“7.bat js vbs转exe的实用工具,只要安装了 .NET Framework 就可以用vbs实现”翻译为“7. Practical tools for converting bat, js, vbs to exe. As long as .NET Framework is installed, it can be implemented with VBS”
“9. Google文件名,对于不熟悉的系统文件名很有用,甚至做一个查找文件名后缀的东东,呵呵”翻译为“9. Google file names, which is very useful for unfamiliar system file names. Even make a thing to find file name extensions, hehe”
“10.获得文件的MD5 CRC32 hash值,呵呵,需要第三方软件支持。其实大家想想,这个功能放到“发送到”很实用的,因为平时我们做文件校检都是 打开 winmd5sum.exe,拖放文件,copy所得计算值,这样做久了很烦啊”翻译为“10. Obtain MD5 and CRC32 hash values of files. Hehe, it requires third-party software support. Actually, think about it, this function is very practical when placed in 'Send To' because usually when we verify files, we open winmd5sum.exe, drag and drop files, and copy the calculated values. It's very tedious to do this for a long time”
“11.简陋的合并文件功能 copy /b +”翻译为“11. Simple file merging function: copy /b +”
“12.有可能的话,结合 memcoder和LAME做编码/解码快捷方式”翻译为“12. If possible, combine memcoder and LAME to make encoding/decoding shortcuts”
“13.Office文档的转换,用 ADODB 做 xls2txt ,即使没有安装excel也可以打开xls文件”翻译为“13. Conversion of Office documents. Use ADODB to do xls2txt, and you can open xls files even without installing Excel”
“14.结合简单的shell技术做文件夹的explorer级别的加密,比如大家熟悉的把一个文件夹伪装成回收站”翻译为“14. Combine simple shell technology to encrypt folders at the explorer level, for example, familiar with disguising a folder as the Recycle Bin”
“15.有兴趣的话再做一个 FTP 上传、映射网络驱动器,subst虚拟磁盘,mountdrv fsutil HardLink的快捷方式,^_^”翻译为“15. If interested, make shortcuts for FTP upload, mapping network drives, subst virtual disks, mountdrv fsutil HardLink, ^_^”
“16.我会考虑用WIA做一个转换图片格式的,用TTS做一个文本到语音的转换脚本”翻译为“16. I will consider using WIA to make a picture format conversion, and use TTS to make a text-to-speech conversion script”
“其实Windows自带的很多exe还有更加广泛的引用,只要大家思路开阔,没有什么不可以~~”翻译为“In fact, many EXEs built into Windows have more extensive applications. As long as everyone has an open mind, nothing is impossible~~”
“ Last edited by electronixtar on 2006-10-3 at 10:24 ]”翻译为“ Last edited by electronixtar on 2006-10-3 at 10:24 ]”
Final Answer:
Several more practical functions occurred to me:
1. Use fsutil to clear files and folders. If not, using copy nul is also okay
2. Convert document types, for example, there are many vbs scripts in old forum posts, like doc2htm, htm2txt, any2bat, bat2exe
3. Script encryption, including bat's Unicode encryption, js/vbs's encoder encryption, and frustrator encryption
4. Conversion between GB2312 and UTF-8, conversion between full-width/half-width, conversion between GBK and traditional Chinese. There are HTML versions online, and it shouldn't be difficult to make a VBS version
5. Conversion of uppercase and lowercase in English txt
6. View NFO in batch processing
7. Practical tools for converting bat, js, vbs to exe. As long as .NET Framework is installed, it can be implemented with VBS
9. Google file names, which is very useful for unfamiliar system file names. Even make a thing to find file name extensions, hehe
10. Obtain MD5 and CRC32 hash values of files. Hehe, it requires third-party software support. Actually, think about it, this function is very practical when placed in 'Send To' because usually when we verify files, we open winmd5sum.exe, drag and drop files, and copy the calculated values. It's very tedious to do this for a long time
11. Simple file merging function: copy /b +
12. If possible, combine memcoder and LAME to make encoding/decoding shortcuts
13. Conversion of Office documents. Use ADODB to do xls2txt, and you can open xls files even without installing Excel
14. Combine simple shell technology to encrypt folders at the explorer level, for example, familiar with disguising a folder as the Recycle Bin
15. If interested, make shortcuts for FTP upload, mapping network drives, subst virtual disks, mountdrv fsutil HardLink, ^_^
16. I will consider using WIA to make a picture format conversion, and use TTS to make a text-to-speech conversion script
In fact, many EXEs built into Windows have more extensive applications. As long as everyone has an open mind, nothing is impossible~~
Last edited by electronixtar on 2006-10-3 at 10:24 ]
|

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-10-3 09:18 |
|
|
无奈何
荣誉版主
      
积分 1338
发帖 356
注册 2005-7-15
状态 离线
|
『第 19 楼』:
使用 LLM 解释/回答一下
Re fastslz
我发现你修改了原始代码,换用原始代码看看,无论我怎么更改 Favorites 的注册表值都屡试不爽。
::set reg="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
set reg="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
for /f "skip=2 tokens=2* delims= " %%i in ('reg query %reg% /v "Favorites"') do set Favorites=%%j
echo %Favorites%
echo.
pause
Re electronixtar
我是看到在别处有转贴,转贴的不完全,还大呼加密云云,让我哭笑不得。索性还不如自己转一下,我觉得刻意的宣传是没有必要的,因为软件还不完善。如果转贴能让更多的人知道咱们论坛并带来人气的话这样做倒是值得的。如果转贴过多会给更新带来麻烦,可以使用下面的地址:www.songjun.org/SendTo+.zip
Re fastslz
I found that you modified the original code. Let's use the original code. No matter how I change the registry value of Favorites, it always works.
::set reg="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
set reg="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
for /f "skip=2 tokens=2* delims= " %%i in ('reg query %reg% /v "Favorites"') do set Favorites=%%j
echo %Favorites%
echo.
pause
Re electronixtar
I saw that there was a reprint elsewhere. The reprint was incomplete, and people were shouting about encryption and so on, which made me laugh and cry. It's better to reprint it myself. I think deliberate promotion is unnecessary because the software is not perfect. If reprinting can let more people know about our forum and bring popularity, then it's worth doing. If there are too many reprints, it will cause trouble for updates. You can use the following address:www.songjun.org/SendTo+.zip
|

☆开始\运行 (WIN+R)☆
%ComSpec% /cset,=何奈无── 。何奈可无是原,事奈无做人奈无&for,/l,%i,in,(22,-1,0)do,@call,set/p= %,:~%i,1%<nul&ping/n 1 127.1>nul
|
|
2006-10-3 09:35 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
|
2006-10-3 09:43 |
|
|
chenall
银牌会员
    
积分 1276
发帖 469
注册 2002-12-23 来自 福建泉州
状态 离线
|
『第 21 楼』:
使用 LLM 解释/回答一下
有空再试试将这个转成VBS脚本.我想应该不是很难.
难的是没有耐心.
I'll try to convert this into a VBS script when I have time. I think it shouldn't be too difficult. The hard part is not having patience.
|

QQ:366840202
http://chenall.net |
|
2006-10-3 09:50 |
|
|
tinytiger
新手上路

积分 8
发帖 4
注册 2006-10-3
状态 离线
|
『第 22 楼』:
使用 LLM 解释/回答一下
好东西啊,多谢楼主!
What a great thing! Thanks to the LZ!
|
|
2006-10-3 09:56 |
|
|
无奈何
荣誉版主
      
积分 1338
发帖 356
注册 2005-7-15
状态 离线
|
『第 23 楼』:
使用 LLM 解释/回答一下
Re electronixtar
你18楼的建议我仔细看了。我觉得软件的定位很重要,我想做的是实用的并且能展示批处理魅力的东西,而不是工具拼合的杂集。
相 2、3、4、7、10 等都需要另外嵌入软件。 6、14 等很好我会好好构思一下。像一些编码及文档的转换 VBS 来做很合适,但是没有人来做。接下来我要做的先修复一下现在的版本,脚本基本上没有加入太多的错误处理。
还有我觉得技术的东西加密是没有必要,特别是咱们并不太高明的技术。相反的如果有人能从这里学到更多的东西,我相信他更愿意来逛逛。
Re electronixtar
I carefully read your suggestion on floor 18. I think the positioning of the software is very important. I want to make something practical and that can demonstrate the charm of batch processing, not a hodgepodge of tool combinations.
Items like 2, 3, 4, 7, 10, etc. need additional embedded software. Items like 6, 14, etc. are very good and I will think about them carefully. For example, some encoding and document conversions are very suitable to be done with VBS, but no one is doing it. Next, what I need to do first is to fix the current version. The script basically doesn't add too much error handling.
Also, I think there is no need to encrypt technical things, especially with our not very sophisticated technology. On the contrary, if someone can learn more things from here, I believe he will be more willing to come and browse.
|

☆开始\运行 (WIN+R)☆
%ComSpec% /cset,=何奈无── 。何奈可无是原,事奈无做人奈无&for,/l,%i,in,(22,-1,0)do,@call,set/p= %,:~%i,1%<nul&ping/n 1 127.1>nul
|
|
2006-10-3 10:13 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 24 楼』:
使用 LLM 解释/回答一下
2 3 4 7 可以用纯脚本完成(见老贴),10当然要用第三方工具了,你的原版sendto+还不是用了第三方工具winclip和shortcut的嘛,呵呵。我可以写一个winclip和shoutcut的vbs版,这样我们就可以实现sendto+完全脚本化了
伪装文件夹,我可以提供国内最齐全的方法,^_^
又想到一个:(不要嫌多哈^_^)
17.写一个替换WFP系统文件的,就是批处理室最近讨论那个 replacer.bat
http://www.cn-dos.net/forum/viewthread.php?tid=23453&fpage=2
这个东西最能展现批处理魅力了,个人觉得,呵呵
Last edited by electronixtar on 2006-10-3 at 10:27 ]
2 3 4 7 can be done with pure scripts (see the old post). Of course, 10 has to use third-party tools. Your original sendto+ also used third-party tools winclip and shortcut, heh heh. I can write a VBS version of winclip and shoutcut, so that we can achieve full scripting of sendto+.
For camouflaging folders, I can provide the most complete methods in China, ^_^.
Another thought: (don't mind it being too many, heh heh)
17. Write a batch to replace WFP system files, which is the replacer.bat recently discussed in the batch processing room.
http://www.cn-dos.net/forum/viewthread.php?tid=23453&fpage=2
This thing best showcases the charm of batch processing, in my opinion, heh heh.
Last edited by electronixtar on 2006-10-3 at 10:27 ]
|

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-10-3 10:15 |
|
|
无奈何
荣誉版主
      
积分 1338
发帖 356
注册 2005-7-15
状态 离线
|
『第 25 楼』:
使用 LLM 解释/回答一下
Re electronixtar
我对 VBS 基本一无所知,所以相关的讨论也没有留意。我对编码转换的脚本比较感兴趣,但没有找到论坛里的链接。我自己也写过一个 UTF8 转 GB 的 Gawk 脚本,但是VBS 的话我不知道怎么调用参数。能写一个 winclip和shoutcut的vbs版太好了,我希望能参照原软件提供参数调用接口。还有一点我觉得必须把住,就是嵌入的脚本(cmd 和 vbs的)一定要自己完成的或者论坛朋友们写的并得到授权的或者是开放代码的,千万不能涉及版权问题。
Re electronixtar
I know almost nothing about VBS, so I didn't pay attention to the relevant discussions. I'm interested in encoding conversion scripts, but I didn't find the link in the forum. I also wrote a Gawk script for UTF8 to GB, but I don't know how to call parameters in VBS. It would be great to have a VBS version of winclip and shoutcut. I hope to refer to the original software to provide a parameter calling interface. One more thing I think must be kept in mind is that the embedded scripts (cmd and vbs) must be ones I completed myself or written by forum friends and authorized or open - source code, and must not involve copyright issues.
|

☆开始\运行 (WIN+R)☆
%ComSpec% /cset,=何奈无── 。何奈可无是原,事奈无做人奈无&for,/l,%i,in,(22,-1,0)do,@call,set/p= %,:~%i,1%<nul&ping/n 1 127.1>nul
|
|
2006-10-3 10:47 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 26 楼』:
使用 LLM 解释/回答一下
编码转换
编码转换是利用一个“字典”的原理做的,所以转换的效果和字典是否足够大有关。
怎么调用参数
cscript xxx.vbs 参数1 参数2 参数3
能写一个 winclip和shoutcut的vbs版
没问题~~
开放代码
在这个论坛学到了这么多东西,开放是我们的义务和责任,我们是学术性质的讨论,又不是商业化的交换,呵呵~~
Coding Conversion
Coding conversion is based on the principle of a "dictionary", so the conversion effect is related to whether the dictionary is large enough.
How to Call Parameters
cscript xxx.vbs parameter 1 parameter 2 parameter 3
Can Write a VBS Version of winclip and shoutcut
No problem~~
Open Code
Having learned so much from this forum, opening up is our obligation and responsibility. We are having academic discussions, not commercial exchanges, heh heh~~
|

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-10-3 11:12 |
|
|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第 27 楼』:
使用 LLM 解释/回答一下
Originally posted by electronixtar at 2006-10-3 10:15:
2 3 4 7 可以用纯脚本完成(见老贴),10当然要用第三方工具了,你的原版sendto+还不是用了第三方工具winclip和shortcut的嘛,呵呵。我可以写一个winclip咠...
我晕...我也想说加个系统文件替换replacer.bat呢,被你抢先了。electronixtar的思路实在宽阔,实在是佩服....
electronixtar有个通杀各种exe安装程序UniExtract是否也考虑加入
Re无奈何版主
我的代码是在你的原始代码上修改的,2个代码都不能正确定位Favorites,郁闷啊
另外对于 20楼: electronixtar 建议我表示支持
Originally posted by electronixtar at 2006-10-3 10:15:
2 3 4 7 can be completed with pure scripts (see old posts). For 10, third-party tools are definitely needed. Your original sendto+ also uses third-party tools like winclip and shortcut, heh heh. I can write a winclip...
Oh my god... I also wanted to mention adding a system file replacement replacer.bat, but you got there first. electronixtar's ideas are really broad, really admirable....
Does electronixtar also consider including the UniExtract that can handle various exe installers?
Re Helpless Moderator
My code is modified from your original code. Both codes can't correctly locate Favorites, really frustrating
Additionally, for post 20: electronixtar's suggestion, I express my support
|

第一高手 第二高手
我的小站
 |
|
2006-10-3 11:13 |
|
|
无奈何
荣誉版主
      
积分 1338
发帖 356
注册 2005-7-15
状态 离线
|
『第 28 楼』:
使用 LLM 解释/回答一下
Re electronixtar
谢谢,太好了,写完了让坛子里的其他 VBS 高手提提意见,争取下一次加入。
Re fastslz
你尝试将命令分解一下,先执行
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Favorites"
观察一下输出结果,再调整 for 的执行参数,期待你的处理结果。
UniExtract 好像是用 Autoit 写的,他打包的软件太多了。还有我觉得提供某种方式能让用户自己添加脚本比较合适,因为命令行下的实用软件太多了。如果你自己用的话你可以自己添加脚本并修改 Install.cmd 文件,有问题的话可以跟贴讨论一下。
还有限制加密相关的帖子的问题我已经说过了,如果像我这样的懒人不解压直接用 Winrar 查看的话已经原文呈现了,所以没有什么意义的,再者我的目的也不是不想让人看到源码,顶多是秀一下咱们论坛的技术。
Last edited by 无奈何 on 2006-10-3 at 11:55 ]
Re electronixtar
Thanks, great. After finishing, let other VBS experts in the forum give some comments and strive to join next time.
Re fastslz
You try to decompose the command, first execute
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Favorites"
Observe the output result, then adjust the execution parameters of for, looking forward to your processing result.
UniExtract seems to be written with Autoit, and it packs too many software. Also, I think it is appropriate to provide a way for users to add scripts by themselves, because there are too many practical software under the command line. If you use it yourself, you can add scripts by yourself and modify the Install.cmd file. If there are any problems, you can post and discuss.
Also, I have already mentioned the problem of restricting posts related to encryption. If lazy people like me do not decompress and directly use Winrar to view, it has been presented in the original text, so it is not meaningful. Moreover, my purpose is not to not want people to see the source code, at most it is to show the technology of our forum.
Last edited by 无奈何 on 2006-10-3 at 11:55 ]
|

☆开始\运行 (WIN+R)☆
%ComSpec% /cset,=何奈无── 。何奈可无是原,事奈无做人奈无&for,/l,%i,in,(22,-1,0)do,@call,set/p= %,:~%i,1%<nul&ping/n 1 127.1>nul
|
|
2006-10-3 11:49 |
|
|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第 29 楼』:
使用 LLM 解释/回答一下
@echo off
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Favorites">测试1.txt
echo.
set reg="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
for /f "skip=2 tokens=1,* delims=:" %%i in ('reg query %reg% /v "Favorites"') do set Favorites=%%j
echo %Favorites%>测试2.txt
echo.
::set reg="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
set reg="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
for /f "skip=2 tokens=2* delims= " %%i in ('reg query %reg% /v "Favorites"') do set Favorites=%%j
echo %Favorites%>测试3.txt
echo.
pause
测试1.txt
! REG.EXE VERSION 3.0
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
Favorites REG_SZ E:\TEMP\Favorites
测试2.txt
\TEMP\Favorites
测试3.txt
ECHO 处于关闭状态。
```
@echo off
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Favorites" > test1.txt
echo.
set reg="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
for /f "skip=2 tokens=1,* delims=:" %%i in ('reg query %reg% /v "Favorites"') do set Favorites=%%j
echo %Favorites% > test2.txt
echo.
::set reg="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
set reg="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
for /f "skip=2 tokens=2* delims= " %%i in ('reg query %reg% /v "Favorites"') do set Favorites=%%j
echo %Favorites% > test3.txt
echo.
pause
test1.txt
! REG.EXE VERSION 3.0
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
Favorites REG_SZ E:\TEMP\Favorites
test2.txt
\TEMP\Favorites
test3.txt
ECHO is off.
```
|

第一高手 第二高手
我的小站
 |
|
2006-10-3 12:10 |
|
|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第 30 楼』:
使用 LLM 解释/回答一下
set reg="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
for /f "skip=2 tokens=1,* delims=REG_SZ" %%i in ('reg query %reg% /v "Favorites"') do set Favorites=%%j
echo %Favorites%>测试4.txt
echo.
测试4.txt
E:\TEMP\Favorites
测试4 Favorites变量是可用的,如果数值类型不是REG_SZ又会出错了:(
Last edited by fastslz on 2006-10-3 at 12:22 ]
```code
set reg="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
for /f "skip=2 tokens=1,* delims=REG_SZ" %%i in ('reg query %reg% /v "Favorites"') do set Favorites=%%j
echo %Favorites%>测试4.txt
echo.
```
测试4.txt
E:\TEMP\Favorites
The Favorites variable for test 4 is available, but it will go wrong if the value type is not REG_SZ :(
Last edited by fastslz on 2006-10-3 at 12:22 ]
|

第一高手 第二高手
我的小站
 |
|
2006-10-3 12:18 |
|
|