|
hygh
初级用户
 
积分 45
发帖 19
注册 2007-2-3
状态 离线
|
『楼 主』:
批处理在被调用时,如果参数很长很复杂那能处理吗?
使用 LLM 解释/回答一下
调用时的参数无法确定会有什么字符,有不少会是像下面红色字部分的,甚至有更复杂的,那能在批处理里面进行完整处理吗?
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
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
|
|
2009-1-8 02:37 |
|
|
everest79
金牌会员
      一叶枝头,万树皆春
积分 2564
发帖 1127
注册 2006-12-25
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
可以
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%"
注意引号就可以了
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 |
|
2009-1-8 06:28 |
|
|
hygh
初级用户
 
积分 45
发帖 19
注册 2007-2-3
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
你可能误会了,我的意思是:某个程序是以下面的格式调用批处理“AA.BAT”,而红色字部分是作为一个参数使用的。另外,调用的格式是无法干预的。在这种情况下,批处理还能对红色字部分进行完整处理吗?
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
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
|
|
2009-1-8 14:20 |
|
|
everest79
金牌会员
      一叶枝头,万树皆春
积分 2564
发帖 1127
注册 2006-12-25
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
我想说的是,试试更健康,例子已经有了,你为啥不试呢
What I want to say is, try something healthier. There are examples already. Why don't you give it a try?
|

49206C6F766520796F752067757973 54656C3A3133383238343036373837 |
|
2009-1-8 16:54 |
|
|
hygh
初级用户
 
积分 45
发帖 19
注册 2007-2-3
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
不是我不想试啊,只是我给出做例子的那段参数不是我定义的,那是批处理以外的EXE程序执行某项操作时定义的,我根本无法给它加引号。
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.
|
|
2009-1-8 17:16 |
|
|
everest79
金牌会员
      一叶枝头,万树皆春
积分 2564
发帖 1127
注册 2006-12-25
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
批处理是你自已写的,难道那个与之配套的应用程序是你打网上下载的?
Batch processing is written by yourself. Did you download the accompanying application from the Internet?
|

49206C6F766520796F752067757973 54656C3A3133383238343036373837 |
|
2009-1-9 13:23 |
|
|
hygh
初级用户
 
积分 45
发帖 19
注册 2007-2-3
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
我写的这个批处理目的是代替IE的原始位置,在任何程序调用IE打开网站的时候,批处理将先分析要打开的网站是否是黑名单中,如果是将忽略,如果否将调用被移到其它位置的IE主程序打开网站。
现在批处理已经基本完成,不带特殊符号的参数都能处理了,就是像上面的参数就不知怎么处理。
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.
|
|
2009-1-10 03:29 |
|
|
linee
初级用户
 
积分 94
发帖 49
注册 2008-12-14
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
比如你在批处理里用%1表示那个参数的话,可以给%1加引号啊,这样:"%1"。
For example, if you use %1 to represent that parameter in a batch script, you can add quotes to %1 like this: "%1".
|
|
2009-1-10 09:36 |
|
|
everest79
金牌会员
      一叶枝头,万树皆春
积分 2564
发帖 1127
注册 2006-12-25
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
这个我也不是很清楚,不过你想实现的功能IE自已就已经带了,一个是安全设置中将你的黑名单添加到受限网站,不过还是可以访问,另一个就是启用IE分级后将所有黑名单添加到自定义网站列表中即可
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 |
|
2009-1-10 10:43 |
|
|
netbenton
银牌会员
     批处理编程迷
积分 1916
发帖 752
注册 2008-12-28 来自 广西
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
只要是参数就可以处理,但主要问题是:这种的参数在dos命令行就已经被解释,会出错或丢失.BAT得到的是解释后的参数.
试试能否把它写到txt文件,再在BAT里用for取出还差不多
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.
|

精简
=> 个人 网志  |
|
2009-1-10 21:23 |
|
|
kurt101
初级用户
 
积分 23
发帖 17
注册 2008-8-22
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
"%1" 试过了吗 ??要自己试才行,不是来求绝对的答案的
"%1" Have you tried it?? You have to try it yourself, not to ask for an absolute answer
|
|
2009-1-13 14:54 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第 12 楼』:
Re 11楼
使用 LLM 解释/回答一下
肯定不行
你自己试试就知道了
It definitely won't work. You'll know it yourself if you try it.
|

 |
|
2009-1-13 16:25 |
|