从批处理文件中打开大URL

时间:2017-05-20 20:29:03

标签: web-services batch-file

我在搜索中尝试过很多例子,但仍然没有找到更接近我的情景。我们想在IE中打开一个URL,它实际上是一个Web服务调用并发送短信。尝试下面的代码;

@START http://172.20.10.1/smsservice/smsservice.asmx/SMSPush?ApplicationID=username&Password=password&MobileNumber="12345678"&MessageText="Test SMS"&ConfirmDelivery=False&Priority=0

但是,IE只会用

打开缩短网址

"http://172.20.10.1/smsservice/smsservice.asmx/SMSPush?ApplicationID=username"

它并没有超越&登录。

非常感谢任何帮助。

4 个答案:

答案 0 :(得分:2)

使用引号

@START "" "http://173.20.10.1/smsservice/smsservice.asmx/SMSPush?ApplicationID=username&Password=password&MobileNumber="12345678"&MessageText="Test%%20SMS"&ConfirmDelivery=False&Priority=0"

答案 1 :(得分:1)

这样可行

@START /d "C:\Program Files\Internet Explorer" IEXPLORE.EXE "http://172.20.10.1/smsservice/smsservice.asmx/SMSPush?ApplicationID=username&Password=password&MobileNumber="12345678"&MessageText="Test SMS"&ConfirmDelivery=False&Priority=0"

答案 2 :(得分:1)

将每个&转义为^&,并在START命令后使用第一组双引号作为空白标题。

@START "" http://172.20.10.1/smsservice/smsservice.asmx/SMSPush?Applic‌​ationID=username^&Pa‌​ssword=password^&Mob‌​ileNumber="12345678"‌​^&MessageText="Test SMS"^&ConfirmDelivery=False^&Priority=0 

这样您就可以不使用双引号,就像在URL字符串周围一样,但是告诉批处理将&符号解释为字符而不是conditional logic

答案 3 :(得分:0)

网址中间的引号必须使用反斜杠进行转义。

@START "" "http://173.20.10.1/smsservice/smsservice.asmx/SMSPush?ApplicationID=username&Password=password&MobileNumber=\"12345678\"&MessageText=\"Test SMS\"&ConfirmDelivery=False&Priority=0"
相关问题