Forum Discussion
nhtkid
Nov 01, 2022Iron Contributor
Script a cmd to set Startup App
Dear Community Members, We have an odd requirement to create a Windows 10 Kiosk Setup to turn into kiosk running different apps. I was able to set up the PC to a multi-app kiosk mode, with n...
Jannik_Reinhard
Nov 05, 2022Iron Contributor
Does this help. For sure you have to customize this script. If you have questions or if you need support let me know.
$appPath = 'C:/...../app.exe'
$trigger = New-ScheduledTaskTrigger -AtLogon
$user = "NT AUTHORITY\SYSTEM" # Specify the account that runs the app
$action = New-ScheduledTaskAction -Execute $appPath # Specify what program to add arguments use -Argument ""
Register-ScheduledTask -TaskName "RunAppAfterLogin" -Trigger $trigger -User $user -Action $action -Force # Specify the name of the task to run with system permissions use -RunLevel Highest
nhtkid
Nov 14, 2022Iron Contributor
I have done the script with a path to WindowsApps folder.
I am not sure whether I have done the path right (whether I have found the right executables). But the first error I encountered is a permission error because WindowsApp folder is protected hidden folder.
I have used the -RunLevel Highest but seems not effective.
Here is the script:
$appPath = 'C:\Program Files\WindowsApps\AppspaceInc.Appspace_2.54.0.0_x64__7nb6hsg4cq4xc'
$trigger = New-ScheduledTaskTrigger -AtLogOn
$user = "NT AUTHORITY\SYSTEM"
$action = New-ScheduledTaskAction -Execute $appPath
Register-ScheduledTask -TaskName "RunAppAfterLogin" -Trigger $trigger -User $user -Action $action -Force -RunLevel Highest
Below is the output from debug.
Register-ScheduledTask : Access is denied.
At line:6 char:1
+ Register-ScheduledTask -TaskName "RunAppAfterLogin" -Trigger $trigger ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [Register-ScheduledTask], CimException
+ FullyQualifiedErrorId : HRESULT 0x80070005,Register-ScheduledTask
Any advice?
Thanks.