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 01, 2022Iron Contributor
Hey nhtkid, did you try to use and powershell script or and endpoint analytics remediation script to execute the command?
nhtkid
Nov 03, 2022Iron Contributor
Hi Jannik, that is what I am planning to do. But I am struggling to find the right command line to put into script that add apps to the Windows Startup.
- Jannik_ReinhardNov 03, 2022Iron ContributorOkay understood. Will write you a example script to do this. Will came back to you tomorrow or latest on saturday.
- Jannik_ReinhardNov 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
- nhtkidNov 14, 2022Iron Contributor
Actually, I just tried the iTunes, also permission denied.
So maybe it is referring to the permission to run the scheduled task, not necessarily the path to apps?
{ $appPath = 'C:\Program Files\iTunes\iTunes.exe' $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 } 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