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 07:07
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Original] SendTo+ Batch Processing Practical Small Tool -- Enhanced Send To DigestII View 77,268 Replies 75
Original Poster Posted 2006-10-02 03:26 ·  中国 北京 中移铁通
荣誉版主
★★★
Credits 1,338
Posts 356
Joined 2005-07-15 12:09
20-year member
UID 40733
Gender Male
Status Offline
-------------------------
A small correction, thanks to fastslz for discovering the problem and 3742668 for proposing a solution.
For the convenience of updating and modifying files in a timely manner, the download is provided in the form of a link.
The following link will be the latest file for all future versions.
Download: www.songjun.org/SendTo+.zip
-------------------------
Because of personal reasons, I haven't been able to come to the forum for some time. It's hard work for brother 3742668 to manage the board; I also saw the news that brother willsort has temporarily withdrawn, and I miss the days of discussing together; at the same time, I congratulate namejm on joining the moderator team. As a moderator, I feel that I am not doing my duty. I have sorted out and refined the small things I originally made and give them to everyone as a small gift for National Day. For specific introductions, you can see the following help file.
This is a small software made with batch processing. The knowledge points involved include querying and adding the registry, adding environment variables, dynamically displaying selection prompts, and how to use configuration files in batch processing, etc. Due to the relatively many functions, although I have done a lot of testing, I still can't guarantee that there will be no problems. For problems, suggestions, and discussions on the code, you are welcome to post replies. Because the functions of batch processing are limited, the software comes with two command-line small tools. It is impossible to implement it purely with batch processing. I hope that friends who are capable and interested can make a VBS script version. I wish everyone a happy holiday.
An attached picture
Help:
This software is a practical tool made with batch processing. After installation, it will add some practical features to "Send To", such as copying file path names, batch renaming, quickly opening directories, saving clipboard text to a file, etc. The realization of the function is completed by more than 20 batch processing scripts. Batch processing has strong customizability. You can even add batch processing scripts by yourself.
●Installation instructions
The initial version only needs to copy the folder to the current user's SendTo directory to use all functions. In the current version, I made an installation batch processing. Just extract the file to any directory and execute Install.cmd to follow the prompts to complete the installation. A large number of CMD command-line features are used in the batch processing script, so it is not compatible with 9X series systems. 2000 should be usable but I haven't tested it. The software installation process will register a user variable, located under HKEY_CURRENT_USER\Environment, the SendTo+ key. The user variable will only take effect after logging off or restarting. After the installation is complete, it will prompt to log off the system.
●Function description
After the default normal installation, a SendTo+ folder will be generated in the current user's SendTo directory. The usage method is to select a file or folder in any directory, point to Send To, and SendTo+ to see the function options. Note that the functions called after selecting a file and a folder are different. Multiple selections are supported, and multiple files or folders are supported as long as the operation is reasonable. The directory list and personal recommendation degree are as follows:
○Command Prompt ★★★
○Open Directory ★★★
 ◇Add this folder
 ◇Remove this folder
○Shortcut
 ◇Add to "Start Menu"
 ◇Add to "Quick Launch" ★★
 ◇Add to "Other Folders" ★★★
 ◇Add to "Favorites"
○Text operation
 ◇Copy text to clipboard
 ◇Clipboard text to same-named text ★★★
 ◇Clipboard text to new text ★★★★
 ◇Clipboard text replace to text
 ◇Clipboard text append to text
 ◇Clear text file
○File operation
 ◇Copy file path to clipboard
 ◇Copy file name to clipboard ★★★
 ◇Copy file full path to clipboard ★★★★
 ◇Random number batch rename ★★★
 ◇Text title batch rename ★★★
 ◇Serial number batch rename
 ◇Create a new folder with the current date
 ◇Create a new folder with the same name or clipboard ★★★
 ◇Undo last batch rename
 ◇Encrypt batch processing file

●Advanced instructions
Since the use of the software is very simple, no excessive description is made. Let's talk about the operation method. Some operations are distinguished between whether the current selection is a file or a folder. For example, when the "Command Prompt" item selects a file, the path of the opened command window is the path where the file is located, and when a folder is selected, it is the path of the selected folder. The same applies to items like "Clipboard text to new text", and it will be renamed with the first line of the text. The most special one is "Create a new folder with the same name or clipboard". Selecting a file will create a folder with the same name. Selecting a folder will create a folder under it with the clipboard content as the name. You can try selecting multiple files and folders to see the effect. There are also some operations that are meaningless. For example, calling "Create a new folder with the current date" for multiple selected files will only generate one folder, but it will be very different for multiple selected folders. There are also some operations that do not distinguish between files, folders, and directories. For example, "Undo last batch rename" has the same result no matter where the operation is performed.
Regarding the name of the folder generated in "Send To", you can modify the content after the = sign in SendTo+.ini to make it more in line with your own usage habits. The names of the operation items under the folder can be modified in Install.cmd, the name of *.lnk following "/f:", and you can add serial numbers to arrange them in the order of habits. ShortcutToFolder.ini in the CMD folder under SendTo+ is the file record added to "Other Folders". The lines starting with "*" will be topped for selection. When the operation is executed, if the required target folder is not here, it will prompt to enter the target location and record it in this file. In subsequent versions, the function of adjusting the order according to the frequency of use will be added. The Desktop.ini with the hidden attribute is the definition file for the folder display icon, please do not delete it.
Known issues: When the file name contains special characters such as & |, the operation may fail. The reason is that the parameters passed to the script by Send To are not in quotes by default, which will cause parsing parameter errors. The way to deal with it is to change the file name to remove special characters or add spaces in the file name. There is no complete solution for this. When multiple files are operated, the error prompt "Windows cannot access the specified device, path, or file. You may not have appropriate permissions to access this item." occurs. It is because too many files are selected, exceeding the character limit of the command line. The solution is to reduce the selection of files.
Two command-line small tools, winclip.exe and Shortcut.exe, are packaged in the software and can be downloaded here: http://dmst.aueb.gr/dds/sw/outwit/. It is much more powerful than Microsoft's clip.exe and Shortcut.exe. I have simply encrypted the batch processing files. The principle is referred to: http://www.cn-dos.net/forum/viewthread.php?tid=22254. The purpose of encryption is not to prevent people from seeing the source code, but to prevent users from making incorrect modifications when they are not familiar. If you are sure what you are doing, you can modify and expand it by yourself. There are simple comments in the batch processing scripts. Welcome to correct and communicate if you have any problems and suggestions.


BY:无奈何@cn-dos.net
mail:wunaihe@gmail.com
2006.10.1


——————————————分割线———————————————


***********************************
版务日志
***********************************
操 作: 主题加精
执行人: 3742668
原 因: 无论从点击还是回复上来看,此贴
都达到精华的标准,且实用性较强
说 明: 由于目前并没有一个明确的加精依
据,所以如果对此次操作持怀疑态度
的朋友可以跟贴指出,或者于站内
的消息系统留言说明。
***********************************


[ Last edited by 无奈何 on 2006-10-3 at 14:36 ]
Recent Ratings for This Post ( 3 in total) Click for details
RaterScoreTime
JasonMing +2 2007-08-02 00:22
516526966 +1 2008-10-11 01:12
rs369007 +2 2008-12-10 22:58
Attachments
SendTo+.gif
  ☆开始\运行 (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 2 Posted 2006-10-02 05:05 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
Great, download, use and learn

Some functions are what I've always wanted. If the SendTo+ menu is not placed in the "Send To" but can be stretched independently, it would be great (similar to the cascading right-click context menu of WinRAR), which is both beautiful and practical. Looking forward to the next version of SendTo+ by the helpless version master to be able to stretch independently.

Finally, thank you for the National Day gift
第一高手 第二高手

Floor 3 Posted 2006-10-02 05:33 ·  中国 上海 松江区 电信
铂金会员
★★★★
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
I found an unstable situation with the "Favorite" addition function. I can't currently send it to the favorites for the following reason:

::Get the "Favorites" folder path from the registry
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

In addition to HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
There is another one
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
I think the above key value is a bit stubborn, and the one that actually works is the following key value. For example, the code for setting the favorites:
REGEDIT4

;Change the IE favorites location

"Favorites"="E:\\TEMP\\Favorites"
;Change the IE favorites location

"Favorites"=hex(2):45,00,3a,00,5c,00,54,00,45,00,4d,00,50,00,5c,00,46,00,61,00,\
76,00,6f,00,72,00,69,00,74,00,65,00,73,00,00,00



The hex value is also E:\TEMP\Favorites

[ Last edited by fastslz on 2006-10-2 at 05:39 ]
第一高手 第二高手

Floor 4 Posted 2006-10-02 05:40 ·  中国 北京 中移铁通
荣誉版主
★★★
Credits 1,338
Posts 356
Joined 2005-07-15 12:09
20-year member
UID 40733
Gender Male
Status Offline
It is impossible to make an independent collapsible menu; it must be implemented by writing a .dll file, but I don't know Windows programming. The compromise is to copy the most commonly used functions to the SendTo root directory, or modify the installation file Install.cmd. Please note that "Open Directory" may not be flexible enough, and other shortcuts that do not depend on the directory where they are located are all right.
  ☆开始\运行 (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 5 Posted 2006-10-02 07:43 ·  中国 四川 成都 电信
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Good stuff, got it.

It is suggested to add a simple function of merging files, using copy /b +

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 6 Posted 2006-10-02 08:09 ·  中国 北京 中移铁通
荣誉版主
★★★
Credits 1,338
Posts 356
Joined 2005-07-15 12:09
20-year member
UID 40733
Gender Male
Status Offline
Re fastslz

Thank you for your feedback. I can't reproduce your error. All modifications to User Shell Folders will be reflected in Shell Folders, and Shell Folders stores the actual paths. Also, reg.exe can't query the key value of User Shell Folders because there is a better place to access, which is under Shell Folders. Can you try to modify the code by yourself?

Re electronixtar

I have considered this function. Due to the complex and changeable file names, it is impossible to control the order of merging files. I can only prompt the user to choose. In this case, the convenience is not as good as typing a few times in the command line. What do you think?
  ☆开始\运行 (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 7 Posted 2006-10-02 09:48 ·  中国 四川 成都 电信
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
The merge function is very useful, and it can be easily accomplished using the sort command.

In fact, WinRAR can merge files, 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 8 Posted 2006-10-02 10:25 ·  中国 广东 佛山 广东睿江科技有限公司
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
There's no way, the moderator's first move is a masterpiece, I'll top it first. Testing in progress...
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
Floor 9 Posted 2006-10-02 10:33 ·  中国 湖南 娄底 新化县 电信
银牌会员
★★★
Credits 1,218
Posts 485
Joined 2006-07-21 21:24
19-year member
UID 58987
From 湖南.娄底
Status Offline
There's no way, the moderator really has remarkable skills. I'll top it first~~~!
Floor 10 Posted 2006-10-02 11:07 ·  中国 湖北 荆门 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline
Welcome back, hehe. Regarding the issues with your two tools, it seems one is for creating shortcuts and the other is for operating the clipboard. I think it should be relatively simple to solve with VBS. It is suggested that you post a specific parameter format so that the majority of VBS enthusiasts can also have a try.
Floor 11 Posted 2006-10-02 11:47 ·  中国 北京 中移铁通
荣誉版主
★★★
Credits 1,338
Posts 356
Joined 2005-07-15 12:09
20-year member
UID 40733
Gender Male
Status Offline
Re 3742668
What I mean is not just replacing these two command-line tools, but completely using VBS to complete all functions and make a pure VBS version. Although I don't understand it, I guess it's all routine operations and won't be too complicated. The VBS version may be more popular than the batch version because the batch can't avoid many drawbacks, such as parameter character limits, special character handling, and the black interface popping up even without interaction. Although I have tried my best to make it not affect the vision, the black shadow will still flash from the taskbar. Launching different versions of the same software allows users to choose according to their needs, which can also be regarded as the development of script technology. I'm very happy if you are interested, and you are the best person I can think of. If the VBS version is done well, the batch version can gradually fade out. It doesn't matter if you don't have time, other friends can also try. Anyone can use SendTo+ all resources. If such a software comes out, I will be very happy as long as it indicates that it is borrowed from our forum.
Re electronixtar
I may want to add this function more than you. sort cannot achieve natural number sorting. GNU sort can achieve it but must specify the character position. It is unlikely to be achieved when the file name is unknown. A feasible way is to predefine some rules and pop up a text editor for users to modify and then merge, but this is too inconvenient, not as handy as a visual software.
  ☆开始\运行 (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 12 Posted 2006-10-02 22:29 ·  中国 广东 广州 番禺区 电信
新手上路
Credits 17
Posts 13
Joined 2006-09-06 13:27
19-year member
UID 61973
Status Offline
I want to study by looking at the source code, but unfortunately the owner has encrypted it. Can you give code that renames all files in the folder to 01.*, 02.*, etc., no matter what the original file name is, without changing the extension? Also give one that changes the extension. Need two of them, and need the source code!
Floor 13 Posted 2006-10-02 23:17 ·  中国 河北 石家庄 联通
新手上路
Credits 4
Posts 3
Joined 2006-09-27 10:30
19-year member
UID 63796
Gender Male
Status Offline
The moderator's move is really generous. Happy National Day!
Floor 14 Posted 2006-10-03 00:31 ·  中国 北京 中移铁通
荣誉版主
★★★
Credits 1,338
Posts 356
Joined 2005-07-15 12:09
20-year member
UID 40733
Gender Male
Status Offline
Re cxmzlxb
Regarding encryption, it has been explained and is very simple. Just refer to the provided post on the encryption principle, and it's easy to get the source code. After a while, when this version is stable, add a batch renaming function for the interactive interface. Initially, it is intended to be able to name with a specified number of digits and character replacement, etc.

Re all
The repost I saw elsewhere made me laugh and cry. I have already said that encryption is not to prevent seeing the source code.
Can the friends who repost please transfer the entire "Help" section?

[ Last edited by 无奈何 on 2006-10-3 at 05:17 ]
  ☆开始\运行 (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 15 Posted 2006-10-03 07:56 ·  中国 四川 阿坝藏族羌族自治州 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
The moderator has a deep research on the registry, heh heh. I'll take a good look at the dynamic display selection prompt.

[ Last edited by he200377 on 2006-10-3 at 08:07 ]
1 2 3 6 Next ›
Forum Jump: