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-06-25 05:19
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Original] SendTo+ Batch Processing Practical Small Tool -- Enhanced Send To DigestII View 77,261 Replies 75
Floor 16 Posted 2006-10-03 08:03 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
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
第一高手 第二高手

Floor 17 Posted 2006-10-03 08:50 ·  中国 四川 成都 电信
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
http://www.cnbeta.com/modules.php?name=News&file=article&sid=16155

Everyone go and support it, don't forget to rate the article 5 points~~~

So the original helpless moderator also visits cnbeta~~~ Hehe

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'>"
Floor 18 Posted 2006-10-03 09:18 ·  中国 四川 成都 电信
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
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'>"
Floor 19 Posted 2006-10-03 09:35 ·  中国 浙江 宁波 鹏博士宽带
荣誉版主
★★★
Credits 1,338
Posts 356
Joined 2005-07-15 12:09
20-year member
UID 40733
Gender Male
Status Offline
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

Floor 20 Posted 2006-10-03 09:43 ·  中国 四川 成都 电信
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Won't those who find that bat is encrypted be depressed to death, ^_^ This is one of the core technologies of our forum~~

In order to protect the forum's independent intellectual property rights, it is hoped that the moderators will add a little point-based browsing restriction to that post discussing batch processing encryption to prevent search engine crawling.

http://www.cn-dos.net/forum/viewthread.php?tid=22254&fpage=1&highlight=%E5%8A%A0%E5%AF%86

[ Last edited by electronixtar on 2006-10-3 at 09:47 ]

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'>"
Floor 21 Posted 2006-10-03 09:50 ·  IANA 局域网IP(Private-Use)
银牌会员
★★★
Credits 1,276
Posts 469
Joined 2002-12-23 13:00
23-year member
UID 586
Gender Male
From 福建泉州
Status Offline
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
Floor 22 Posted 2006-10-03 09:56 ·  中国 山东 东营 联通
新手上路
Credits 8
Posts 4
Joined 2006-10-03 05:37
19-year member
UID 64382
Status Offline
What a great thing! Thanks to the LZ!
Floor 23 Posted 2006-10-03 10:13 ·  中国 河南 洛阳 鹏博士宽带
荣誉版主
★★★
Credits 1,338
Posts 356
Joined 2005-07-15 12:09
20-year member
UID 40733
Gender Male
Status Offline
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

Floor 24 Posted 2006-10-03 10:15 ·  中国 四川 成都 电信
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
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'>"
Floor 25 Posted 2006-10-03 10:47 ·  中国 河南 洛阳 鹏博士宽带
荣誉版主
★★★
Credits 1,338
Posts 356
Joined 2005-07-15 12:09
20-year member
UID 40733
Gender Male
Status Offline
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

Floor 26 Posted 2006-10-03 11:12 ·  中国 四川 成都 电信
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline

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'>"
Floor 27 Posted 2006-10-03 11:13 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
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
第一高手 第二高手

Floor 28 Posted 2006-10-03 11:49 ·  中国 河南 洛阳 鹏博士宽带
荣誉版主
★★★
Credits 1,338
Posts 356
Joined 2005-07-15 12:09
20-year member
UID 40733
Gender Male
Status Offline
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

Floor 29 Posted 2006-10-03 12:10 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
```
@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.

```
第一高手 第二高手

Floor 30 Posted 2006-10-03 12:18 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
```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 ]
第一高手 第二高手

Forum Jump: