通过 .vbs 脚本调用 https 页面失败...为什么?

发布于 2024-08-19 00:58:37 字数 559 浏览 4 评论 0原文

这是脚本。尝试自行执行...nada。尝试通过任务调度程序执行...nada。如果我通过 IE 点击下面的 URL,它就会起作用。有什么想法吗???

''//Force the script to finish on an error.
On Error Resume Next

''//Declare variables
Dim objRequest
Dim URL

Set objRequest = CreateObject("Microsoft.XMLHTTP")

''//Put together the URL link appending the Variables.
URL = "https://myurlhere.com"

''//Open the HTTP request and pass the URL to the objRequest object
objRequest.open "GET", URL , false

''//Send the HTML Request
objRequest.Send

''//Set the object to nothing
Set objRequest = Nothing

Here's the script. Tried executing by itself ... nada. Tried executing via task scheduler ... nada. If I hit the URL below via IE it works. Any ideas???

''//Force the script to finish on an error.
On Error Resume Next

''//Declare variables
Dim objRequest
Dim URL

Set objRequest = CreateObject("Microsoft.XMLHTTP")

''//Put together the URL link appending the Variables.
URL = "https://myurlhere.com"

''//Open the HTTP request and pass the URL to the objRequest object
objRequest.open "GET", URL , false

''//Send the HTML Request
objRequest.Send

''//Set the object to nothing
Set objRequest = Nothing

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雪落纷纷 2024-08-26 00:58:37

“在 Internet Explorer 8 中,不支持 VBScript 语法”

-- http://msdn.microsoft.com/en-us/library/ms535874%28VS.85%29.aspx

这可能是问题所在吗?

"In Internet Explorer 8, the VBScript syntax is not supported"

-- http://msdn.microsoft.com/en-us/library/ms535874%28VS.85%29.aspx

Could this be the problem?

绅刃 2024-08-26 00:58:37

问题是该页面需要 Windows 身份验证,即使脚本作为经过身份验证的用户运行......它由于在询问时未响应用户名和密码而失败。

解决方案:
* 启用匿名身份验证
* 更新 web.config,以便通知控制器不需要经过身份验证的用户

The problem was that the page was requiring windows authentication and even though the script was running as an authenticated user ... it was failing due to not responding with a username and password when asked.

Solution:
* Enable anonymous authentication
* Update web.config so that notification controller didn't require an authenticated user

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文