ivan rosa
asked on
Not Launching Chrome from a Powershell within a Task Scheduler
Hello Guys,
I have in various PS scripts within the Task Scheduler and they all work fine except for this one that launches a chrome website.
for the sake of the purpose the below would fit my question
here's a view from the Task Sequence:
Use in Program/script field
I have in various PS scripts within the Task Scheduler and they all work fine except for this one that launches a chrome website.
for the sake of the purpose the below would fit my question
$googlePath = "C:\Program Files\Google\Chrome\Application\chrome.exe"
$Google = "https://www.google.com"
$msn = "https://www.msn.com"
$getMDate = (Get-Date).Month
if ($getMDate -eq "5") {
Start-Process -FilePath $googlePath -ArgumentList $($Google) -Verb RunAs -PassThru
}else{
Start-Process -FilePath $googlePath -ArgumentList $($msn) -Verb RunAs -PassThru
}
here's a view from the Task Sequence:
Use in Program/script field
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
and add argument-NoProfile -NoLogo -NonInteractive -ExecutionPolicy Bypass -File “C:\Temp\kicks.ps1”
any thoughts? :)
ASKER
Yes, chrome is default browser
by the way thanks for the comment, however I run into the same issue. It runs perfect in the console, but if you run it from the "Task Scheduler" then it fails.
furthermore I even added in the "Environment Variable" list
by the way thanks for the comment, however I run into the same issue. It runs perfect in the console, but if you run it from the "Task Scheduler" then it fails.
furthermore I even added in the "Environment Variable" list
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
the user needs to be logged in so change it from logged in or not
Open in new window