Welcome to the community forums for Theopenem. All responses are provided by other users that wish to help out. Theopenem will not respond to these posts. If you require more assistance than what the community can provide, we offer various paid support options.

Non-working shortcut when created via Toec


  • I'm trying to create a shortcut via Toec with the following power shell lines. This works when ran on manually by running the power shell script on a test computer, but via Toec the behavior is different.

    Toec creates the shortcut but when you double click it, it doesn't open at all.

    $shell = New-Object -comObject WScript.Shell
    $shortcut = $shell.CreateShortcut("C:\Users\Public\Desktop\Staff Shortcuts.lnk")
    $shortcut.TargetPath = "\servername\DesktopShortcuts\Staff Shortcuts"

    Give the shortcut a specific icon, on this example the Star icon, # $shortcut.IconLocation = "shell32.dll,43"

    $shortcut.IconLocation = "shell32.dll,43"
    $shortcut.Save()


  • I suspect that wscript.shell needs a user context instead of service.


  • @theopenem_admin said in Non-working shortcut when created via Toec:

    I suspect that wscript.shell needs a user context instead of service.

    I was able to get around it by using file copy to place the shortcut. Thanks for your time looking into it.