$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("C:\Users\$user\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\CheckLauncher.lnk")
$Shortcut.TargetPath = "cmd.exe"
$Shortcut.Arguments = "C:\Users\Administrator\Desktop\Packages\checkLauncher.bat"
Error
Exception calling "Save" with "0" argument(s): "Unable to save shortcut "C:\Use
rs\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\
CheckLauncher.lnk"."
At C:\Users\Administrator\Desktop\Packages\Setup.ps1:22 char:15
+ $Shortcut.Save <<<< ()
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ComMethodTargetInvocation
I assure you that this path - C:\Users\Administrator\Desktop\Packages\checkLauncher.bat does exist. Please do help to find out what is wrong with this.
Any help is awaited.. Thanks in advance