'Trying to start firefox from a batch file (task scheduler) using Windows Powershell, but the window is not appearing
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.
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | unsolaci |
