尝试使用Windows PowerShell从批处理文件(任务调度程序)启动Firefox,但该窗口没有出现

发布于 2025-01-18 11:41:20 字数 352 浏览 4 评论 0原文

我正在尝试在 Windows powershell 中运行一个命令来启动任务计划。下面是我正在使用的命令: Start-ScheduledTask -TaskName“pkms 任务调度程序” powershell 可以从调度程序运行任务和批处理文件,但我不知道为什么即使浏览器在后台运行,Firefox 窗口也没有出现,是什么问题。 这是批处理文件的代码: @echo off cls start "" /d "C:\Kiosk Advertising" firefox.exe.lnk exit

希望你能帮助我。如果您需要更多信息,请发表评论

我确实尝试将“/max”放在启动命令旁边,但窗口仍然没有出现。

I am trying to run a command in windows powershell that will start a task schedule. Below is the command that I am using:
Start-ScheduledTask -TaskName "pkms task scheduler"
The powershell can run the task and the batch files from the scheduler but I do not know what is the problem why the Firefox window is not appearing even though the browser is running in the background.
Here is the code for the batch file:
@echo off cls start "" /d "C:\Kiosk Advertisement" firefox.exe.lnk exit

Hope that you can help me. Comment if you need more information

I did try to put "/max" beside the start command but the window is still not appearing.

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

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

发布评论

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

评论(1

﹏半生如梦愿梦如真 2025-01-25 11:41:21

如果您的目标只是启动Firefox,那么最简单的方法是使用Firefox可执行文件的路径来创建计划的任务操作,例如:

$StartFirefoxScheduledTaskAction = 
    New-ScheduledTaskAction `
        -Execute 'C:\Program Files\Mozilla Firefox\firefox.exe'

Register-ScheduledTask `
    -TaskName 'Start Firefox' `
    -Action $StartFirefoxScheduledTaskAction

注意:您可以通过多个 action /em>到寄存器 - 安排了's -Action参数。

现在,如果您需要更复杂的东西,请详细说明您的问题,并告诉我们您要通过更多细节来实现的目标。

If your goal is just to start Firefox, the simplest way would be to use the path to your firefox executable to create the scheduled task action, like so:

$StartFirefoxScheduledTaskAction = 
    New-ScheduledTaskAction `
        -Execute 'C:\Program Files\Mozilla Firefox\firefox.exe'

Register-ScheduledTask `
    -TaskName 'Start Firefox' `
    -Action $StartFirefoxScheduledTaskAction

Note: you can pass multiple actions to the Register-ScheduledTask's -Action parameter.

Now, if you need something more sophisticated, please elaborate your question and tell us what you're trying to achieve with more details.

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