![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-11 06:19 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS批处理 & 脚本技术(批处理室) » Can batch processing handle long and complex parameters when it is called? |
| Printable Version 1,464 / 11 |
| Floor1 hygh | Posted 2009-01-08 02:37 |
| 初级用户 Posts 19 Credits 45 | |
|
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 |
|
| Floor2 everest79 | Posted 2009-01-08 06:28 |
| 金牌会员 Posts 1,127 Credits 2,564 | |
|
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. |
|
| Floor3 hygh | Posted 2009-01-08 14:20 |
| 初级用户 Posts 19 Credits 45 | |
|
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 |
|
| Floor4 everest79 | Posted 2009-01-08 16:54 |
| 金牌会员 Posts 1,127 Credits 2,564 | |
|
What I want to say is, try something healthier. There are examples already. Why don't you give it a try?
|
|
| Floor5 hygh | Posted 2009-01-08 17:16 |
| 初级用户 Posts 19 Credits 45 | |
|
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.
|
|
| Floor6 everest79 | Posted 2009-01-09 13:23 |
| 金牌会员 Posts 1,127 Credits 2,564 | |
|
Batch processing is written by yourself. Did you download the accompanying application from the Internet?
|
|
| Floor7 hygh | Posted 2009-01-10 03:29 |
| 初级用户 Posts 19 Credits 45 | |
|
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.
|
|
| Floor8 linee | Posted 2009-01-10 09:36 |
| 初级用户 Posts 49 Credits 94 | |
|
For example, if you use %1 to represent that parameter in a batch script, you can add quotes to %1 like this: "%1".
|
|
| Floor9 everest79 | Posted 2009-01-10 10:43 |
| 金牌会员 Posts 1,127 Credits 2,564 | |
|
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.
|
|
| Floor10 netbenton | Posted 2009-01-10 21:23 |
| 银牌会员 Posts 752 Credits 1,916 From 广西 | |
|
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. |
|
| Floor11 kurt101 | Posted 2009-01-13 14:54 |
| 初级用户 Posts 17 Credits 23 | |
|
"%1" Have you tried it?? You have to try it yourself, not to ask for an absolute answer
|
|
| Floor12 HAT | Posted 2009-01-13 16:25 |
| 版主 Posts 5,017 Credits 9,023 | |
|
It definitely won't work. You'll know it yourself if you try it.
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |