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-08-11 05:28
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Can batch processing handle long and complex parameters when it is called? View 1,462 Replies 11
Original Poster Posted 2009-01-08 02:37 ·  中国 广东 广州 番禺区 电信
初级用户
Credits 45
Posts 19
Joined 2007-02-03 00:35
19-year member
UID 78455
Gender Male
Status Offline
When the parameters during the call cannot be determined, there will be many characters like the parts in red below, and even more complex ones. Can it be completely processed in the batch processing?
http://ptlogin2.qq.com/jump?clientuin=165614042&clientkey=D36C0CFDC5F36DDD07A535D5849D1D74C27827EBEECBF3304C856AD86753B0C8&u1=http://200255222.qzone.qq.com/blog/1219752185&ADUIN=165614042&ADSESSION=1231340330&ADTAG=CLIENT.QQ.1855_QQUrlReportBlankZone.0
Floor 2 Posted 2009-01-08 06:28 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
Yes
set "a=http://ptlogin2.qq.com/jump?clientuin=165614042&clientkey=D36C0CFDC5F36DDD07A535D5849D1D74C27827EBEECBF3304C856AD86753B0C8&u1=http://200255222.qzone.qq.com/blog/1219752185&ADUIN=165614042&ADSESSION=1231340330&ADTAG=CLIENT.QQ.1855_QQUrlReportBlankZone.0"
echo "%a%"
Just pay attention to the quotes.
49206C6F766520796F752067757973 54656C3A3133383238343036373837
Floor 3 Posted 2009-01-08 14:20 ·  中国 广东 广州 番禺区 电信
初级用户
Credits 45
Posts 19
Joined 2007-02-03 00:35
19-year member
UID 78455
Gender Male
Status Offline
You may have misunderstood. What I mean is: a certain program calls a batch file in the following format "AA.BAT", and the part in red is used as an argument. Also, the calling format cannot be intervened. In this case, can the batch file still fully process the part in red?
AA.BAT http://ptlogin2.qq.com/jump?clientuin=165614042&clientkey=D36C0CFDC5F36DDD07A535D5849D1D74C27827EBEECBF3304C856AD86753B0C8&u1=http://200255222.qzone.qq.com/blog/1219752185&ADUIN=165614042&ADSESSION=1231340330&ADTAG=CLIENT.QQ.1855_QQUrlReportBlankZone.0
Floor 4 Posted 2009-01-08 16:54 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
What I want to say is, try something healthier. There are examples already. Why don't you give it a try?
49206C6F766520796F752067757973 54656C3A3133383238343036373837
Floor 5 Posted 2009-01-08 17:16 ·  中国 广东 广州 番禺区 电信
初级用户
Credits 45
Posts 19
Joined 2007-02-03 00:35
19-year member
UID 78455
Gender Male
Status Offline
It's not that I don't want to try. It's just that the parameter segment I gave as an example wasn't defined by me. It was defined when an EXE program outside the batch processing performed a certain operation, and I can't add quotes to it at all.
Floor 6 Posted 2009-01-09 13:23 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
Batch processing is written by yourself. Did you download the accompanying application from the Internet?
49206C6F766520796F752067757973 54656C3A3133383238343036373837
Floor 7 Posted 2009-01-10 03:29 ·  中国 广东 广州 番禺区 电信
初级用户
Credits 45
Posts 19
Joined 2007-02-03 00:35
19-year member
UID 78455
Gender Male
Status Offline
The purpose of the batch file I wrote is to replace the original location of IE. When any program calls IE to open a website, the batch file will first analyze whether the website to be opened is in the blacklist. If it is, it will be ignored; if not, it will call the IE main program moved to another location to open the website. Now the batch file is basically completed, and it can handle parameters without special symbols, but I don't know how to handle parameters like the above.
Floor 8 Posted 2009-01-10 09:36 ·  中国 贵州 安顺 电信
初级用户
Credits 94
Posts 49
Joined 2008-12-14 20:47
17-year member
UID 133884
Gender Male
Status Offline
For example, if you use %1 to represent that parameter in a batch script, you can add quotes to %1 like this: "%1".
Floor 9 Posted 2009-01-10 10:43 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
I'm not very clear about this either. But the function you want to implement is already built into IE. One is to add your blacklist to restricted sites in the security settings, but it can still be accessed. The other is to enable IE content ratings and then add all blacklisted sites to the custom site list.
49206C6F766520796F752067757973 54656C3A3133383238343036373837
Floor 10 Posted 2009-01-10 21:23 ·  中国 广东 东莞 电信
银牌会员
★★★
批处理编程迷
Credits 1,916
Posts 752
Joined 2008-12-28 04:30
17-year member
UID 135147
Gender Male
From 广西
Status Offline
As long as it's a parameter, it can be processed, but the main problem is: such parameters are already interpreted in the DOS command line, which will cause errors or loss. The BAT gets the interpreted parameters.

Try to see if it can be written to a txt file and then taken out with for in the BAT.
精简
=> 个人网志
Floor 11 Posted 2009-01-13 14:54 ·  中国 广西 南宁 电信
初级用户
Credits 23
Posts 17
Joined 2008-08-22 21:53
17-year member
UID 123905
Gender Male
Status Offline
"%1"  Have you tried it?? You have to try it yourself, not to ask for an absolute answer
Floor 12 Posted 2009-01-13 16:25 ·  美国 惠普HP
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
It definitely won't work. You'll know it yourself if you try it.
Forum Jump: