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:18
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Original] SendTo+ Batch Processing Practical Small Tool -- Enhanced Send To DigestII View 77,260 Replies 75
Floor 31 Posted 2006-10-03 12:31 ·  中国 河南 洛阳 鹏博士宽带
荣誉版主
★★★
Credits 1,338
Posts 356
Joined 2005-07-15 12:09
20-year member
UID 40733
Gender Male
Status Offline
Re fastslz

What system are you using? It seems to be 2000? Your reg is different from my version, and the output is also different. Try adjusting the value after skip=, try setting it to 1, or change it to another number, or remove skip=.

[ Last edited by 无奈何 on 2006-10-3 at 12:45 ]
  ☆开始\运行 (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 32 Posted 2006-10-03 13:03 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
Strange, XP SP2呀
Bill has specialized it for me
第一高手 第二高手

Floor 33 Posted 2006-10-03 13:18 ·  中国 湖北 荆门 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline
Re fastslz:

Regarding your test 3, the following points can be obtained from your test 1:
1. skip is best == 4
2. "delims= " is invalid.

In your display result, there is content with 8 spaces after REG_SZ, which is easily associated with the fact that tab in Windows defaults to occupying 8 characters. Also, in batch processing, if delims is not specified, the default delims is space/Tab, so it is obvious that your "delims= " parameter is ineffective, and instead, it will make the tab character lose the role of splitting tokens.

It is suggested to test the following codes:

code 1:

@echo off
set reg="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
for /f "tokens=2,*" %%i in ('reg query %reg% /v "Favorites"') do set Favorites=%%j
echo %Favorites%
pause


code 2:

@echo off
set reg="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
for /f "tokens=2,* delims=这里是个tab" %%i in ('reg query %reg% /v "Favorites"') do set Favorites=%%j
echo %Favorites%
pause




end:

As for your test 4, it is even less universal. If any character in REG_SZ is included in the output of the reg command, it may get an incorrect result. Because the delims parameter does not obtain the delimiter according to the string, but treats the string after delims= as the delimiter set, that is, any character in it is regarded as a delimiter. (Case-sensitive)

Reference:

skip=n - Refers to the number of lines to ignore at the beginning of the file.
delims=xxx - Refers to the delimiter set. This replaces the default delimiter set of space and tab.
tokens=x,y,m-n - Refers to which symbols of each line are passed to the for itself in each iteration. This will lead to the assignment of additional variable names. The format of m-n is a range. The mth is specified by the nth symbol. If the last character in the symbol string is an asterisk, then additional variables will be assigned after the last symbol is parsed and accept the reserved text of the line.
Floor 34 Posted 2006-10-03 14:16 ·  中国 河南 洛阳 鹏博士宽带
荣誉版主
★★★
Credits 1,338
Posts 356
Joined 2005-07-15 12:09
20-year member
UID 40733
Gender Male
Status Offline
Thanks to the reminder from brother 3742668, the original intention was to add skip to increase efficiency, but it seems it was unnecessary. Make a correction. I'm using 2k3 now, and it seems it's really necessary to install a virtual machine for more testing.
  ☆开始\运行 (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 35 Posted 2006-10-03 14:32 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
Thanks to 3742668 for the solution. After reading your reference, I have a deeper understanding.

The following is the summary:

1: Due to the particularity of my Windows XP pro SP2 (it has been confirmed that reg.exe has not been replaced), unfortunately, the version master's code cannot be executed normally in my XP, while this code can be executed normally in 2003.

:: Version master's code
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%



2: The version master's code of 3742668 can be executed normally in my XP and this code can also be executed normally in 2003. It can be seen that the version master's code of 3742668 has stronger universality

:: Version master's code of 3742668
set reg="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
for /f "tokens=2,*" %%i in ('reg query %reg% /v "Favorites"') do set Favorites=%%j
echo %Favorites%
pause


3: Regarding the description of my Windows XP version, the Windows XP pro SP2 product ID belongs to the 011 segment (the generally passed XP version product ID on the network generally belongs to the 640 segment). I have found that these two versions of XP are indeed different since I have been using it.
All XP patches have been updated to 2006-10, and the.NET Framework 2.0 has been installed. These are the only differences. reg.exe MD5: 7f1e65bde053985ba645340bc0cf6497
第一高手 第二高手

Floor 36 Posted 2006-10-03 14:38 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
Hehe...It seems the moderator hasn't slept yet either. You've worked hard, take care of your health哦
第一高手 第二高手

Floor 37 Posted 2006-10-06 11:02 ·  中国 湖北 荆门 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline
The VBS version has two functions. I accidentally deleted it when I uploaded and modified it last night. I'm uploading it again today. Everyone, please help test it.
After extracting the attachment to the directory, run the "Install.vbs" in it to install.
Because I've been very busy these days and a little under the weather, the code isn't well-organized and is very messy. Don't laugh at the experts.
Attachments
SendTo+(VBS版).rar (3.29 KiB, Credits to download 1 pts, Downloads: 102)
Floor 38 Posted 2006-10-08 05:42 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
The VBS version I like ^_^

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 39 Posted 2006-10-08 05:48 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
I also downloaded and tried it. The VBS version is more streamlined.
electronixtar, your VBS skills are also remarkable. Let's show off some time later ^_^
第一高手 第二高手

Floor 40 Posted 2006-10-08 07:00 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Cold~~ What I wrote in VBS is just a fragment. There's still a long way to go compared to the moderators.

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 41 Posted 2006-10-10 23:50 ·  中国 北京 中移铁通
荣誉版主
★★★
Credits 1,338
Posts 356
Joined 2005-07-15 12:09
20-year member
UID 40733
Gender Male
Status Offline
Thanks 3742668
Hard work, good health is the most important. I also feel uncomfortable everywhere recently.
Try it first!
  ☆开始\运行 (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 42 Posted 2006-10-12 07:30 ·  中国 湖北 荆门 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline
Today I checked 3 scripts and found a few minor issues, but they don't affect usage. I wonder if anyone has tested and found problems? As for the other functions, they are all relatively simple. Has no one tried them?
Floor 43 Posted 2006-11-23 05:02
中级用户
★★
DOS之日
Credits 337
Posts 161
Joined 2006-11-04 05:27
19-year member
UID 69523
Gender Male
Status Offline
Support 无奈何
for /f %%h in (`echo hxuan`) do for /f %%x in (`echo hxuan`) do if %%h==%%x nul
Floor 44 Posted 2006-11-25 03:11 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Very wonderful post~~ Admire infinitely~:)
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 45 Posted 2006-11-25 03:44 ·  中国 北京 朝阳区 联通
高级用户
★★
朦胧的世界
Credits 579
Posts 218
Joined 2006-10-24 04:29
19-year member
UID 67972
Status Offline
Enjoy together...

认识自己,降伏自己,改变自己
,才能改变别人!
Forum Jump: