简体   繁体   English

网站登录蝙蝠脚本未通过 Windows 任务计划程序运行

[英]Website Login Bat Script Not Running via Windows Task Scheduler

Full disclosure - scripting isn't my forte.完全披露——脚本不是我的强项。 I have the following script that will log into a website for me at 8:00 AM every morning and I use the SENDKEYS command to tab through a few prompts and it ultimately logs me into a remote sever- once I'm logged in I get an email that's sent to me from the website.我有以下脚本,它将在每天早上 8:00 为我登录一个网站,我使用 SENDKEYS 命令通过一些提示进行选项卡,它最终将我登录到远程服务器 - 一旦我登录我得到从网站发送给我的 email。 Here's a copy of the code:这是代码的副本:

My Issue: I can execute this manually and it will run no problem.我的问题:我可以手动执行它,它运行没有问题。 Using Windows Task Scheduler states that it has successfully ran - but I have no email and no access to the remote server indicating that it did not run as desired.使用 Windows 任务计划程序表明它已成功运行 - 但我没有 email 并且无法访问远程服务器,表明它没有按预期运行。

Can anyone help me here?有人能帮我一下吗? I've researched this extensively, no luck.我已经对此进行了广泛的研究,没有运气。

@if (@CodeSection == @Batch) @then
@echo off
set SendKeys=CScript //nologo //E:JScript "%~F0"
START CHROME "http website"
timeout /t 10
rem %SendKeys% "{TAB}"
%SendKeys% "{TAB}"
%SendKeys% "{TAB}"
%SendKeys% "{ENTER}"
timeout /t 3
%SendKeys% "{ENTER}"
timeout /t 3
taskkill /F /IM chrome.exe /T
goto :EOF
@end
// JScript section
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys(WScript.Arguments(0));

Task Scheduler General Tab任务计划程序常规选项卡

Task Scheduler Actions Tab任务计划程序操作选项卡

Task Scheduler Conditions Tab任务计划程序条件选项卡

Late to the party, I'm trying to do the same thing but then I learned that SendKeys do not get executed if you are logged off from the computer.派对迟到了,我正在尝试做同样的事情,但后来我了解到,如果您从计算机上注销,SendKeys 不会被执行。 Unfortunately, looks like there is no workaround for this.不幸的是,看起来没有解决方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM