Hi. About VBScript (cscript.exe) deprecation, I have scripts to create desktop shortcuts using WScript.Shell:
Set oWS = WScript.CreateObject("WScript.Shell")
sLinkFile = "%USERPROFILE%\Desktop\Publico.lnk"
Set oLink = oWS.CreateShortcut(sLinkFile)
oLink.TargetPath = "P:"
oLink.Save
How can I create the same script using PowerShell without cscript.exe? From what I've seen, the option for PowerShell is to use WScript.Shell, doesn't this mean that PowerShell still uses cscript.exe?
$ShortcutPath = "$env:USERPROFILE\Desktop\MyShortcut.lnk"
$TargetPath = "C:\Path\To\Your\Target.exe"
$WshShell = New-Object -ComObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut($ShortcutPath)
$Shortcut.TargetPath = $TargetPath
$Shortcut.Save()
Thanks in advance.
Regards.