dongxiang5879 2014-10-13 14:37
浏览 59
已采纳

安排Windows任务以打开包含用户名和密码的页面

How would you run a windows task schedule to open a webpage, post login information and then run the url?

Background:

CRM has crons that were setup for a linux only. It has a manager where I can run the jobs as well manually. I want to run the web url that does these jobs manually through the windows server but requires that each time it connect it login with a specific user.

How would I setup a scheduled task on windows server that : 1. Opens and Logs into page then runs the url for the manual job.

  1. Runs every minute

So essentially it needs to look like this:

http://thewebsitename.com/?username=someuser&password=apass
http://thewebsitename.com/theurltorunjobmanually.php

Can scheduled tasks run a php command instead as well? For example if I set up a WGET script, could the scheduler run that php script? Have not been able to figure out how to do this, linux seems to be pretty easy in this scenario

  • 写回答

3条回答 默认 最新

  • douluo3256 2014-10-13 15:34
    关注

    This could be as simple as:

    wget --post-data "username=someuser&password=apass" http://thewebsitename.com/
    wget http://thewebsitename.com/theurltorunjobmanually.php
    

    You also asked about running a PHP script via the scheduled task, you can add this line to the batch script:

    C:\path\to\PHP.exe script.php
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog