【问题标题】:How to run program on ( ubuntu bash windows 10 ) from windows task scheduler如何从 Windows 任务调度程序在(ubuntu bash windows 10)上运行程序
【发布时间】:2017-10-04 17:55:57
【问题描述】:

我需要在 ubuntu bash 中每 5 分钟执行一次任务,我喜欢使用 windows 任务调度程序。 我不知道如何编写 .bat 文件以在 ubuntu bash 中启动应用程序。 我测试了这些并没有工作。 c:\Windows\System32\bash.exe -l [程序名称参数]

【问题讨论】:

  • 不清楚你想做什么,你能解释一下吗?
  • 我需要在 ubuntu bash 中使用 windows 任务调度器来调度任务。

标签: windows bash ubuntu windows-subsystem-for-linux taskscheduler


【解决方案1】:

可以在 ubuntu bash 上运行命令,在 args 中添加 -c 标志

c:\Windows\System32\bash.exe -c <command>

并将其写入.bat文件,然后添加到windows任务调度程序中。

【讨论】:

  • 当我这样做时,我在结果中得到一个 0x75 代码并且脚本没有被执行。
  • 打开 cmd 并尝试 bash.exe -c "echo hi" 检查一切是否正常
  • 是用户未登录时运行的问题。谢谢。
猜你喜欢
  • 2021-12-23
  • 2017-11-22
  • 1970-01-01
  • 1970-01-01
  • 2014-06-06
  • 2022-07-07
  • 1970-01-01
  • 2014-01-23
相关资源
最近更新 更多