opening exam write pad app on start up via intune

Steel Contributor

Hi all


I am using this to try opening the app on start up however I have had no luck! 


#Create shortcut in all users startup folder
if (-not (Test-Path "C:\Users\Public\Desktop\RemoteApp.url"))
$null = $WshShell = New-Object -comObject WScript.Shell
$path = "C:\Program Files\ExamWritePad\ExamWritePad.url"
$targetpath = "C:\Program Files\ExamWritePad\ExamWritePad.exe"
$iconlocation = "C:\Program Files\ExamWritePad\ExamWritePad.exe"
$iconfile = "IconFile=" + $iconlocation
$Shortcut = $WshShell.CreateShortcut($path)
$Shortcut.TargetPath = $targetpath

Add-Content $path "HotKey=0"
Add-Content $path "$iconfile"
Add-Content $path "IconIndex=0"
Any ideas?
2 Replies
best response confirmed by AB21805 (Steel Contributor)
changing path to $path = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\ExamWritePad.url"