Shortcut with 2 entrys by Targetpath

//Shortcut with 2 entrys by Targetpath
Shortcut with 2 entrys by Targetpath2015-06-10T16:50:24+00:00

The Toolkit Forums General Shortcut with 2 entrys by Targetpath

  • Author
    Posts
  • André
    Participant
    Post count: 9

    Hello,

    i would like to create a shortcut on the desktop and this goes fine with PSAPPDEP but my problem is that i would like use two entry on the Target path.

    -TargetPath “C:\Windows\System32\runas.exe $envWinDir\system32\notepad.exe”

    but with them i become errors in the logs and would like not be created.

    i tried it with a variable to create this as:

    [string]%PFAD = “C:\Windows\System32\runas.exe $envWinDir\system32\notepad.exe”

    and then as -TargetPath $PFAD but there comes the same error too.

    The Example in the documentation runs fine.

    New-Shortcut -Path “$envProgramData\Microsoft\Windows\Start Menu\My Shortcut.lnk” -TargetPath “$envWinDir\system32\notepad.exe” -IconLocation “$envWinDir\system32\notepad.exe” -Description ‘Notepad’ -WorkingDirectory “$envHomeDrive\$envHomePath”

    anyone an idea? thanks a lot

    André

  • That_annoying_guy
    Participant
    Post count: 42

    Time for you to use New-Shortcut’s -Arguments parameter:

    New-Shortcut -Path “$envProgramData\Microsoft\Windows\Start Menu\My Shortcut.lnk” -TargetPath “C:\Windows\System32\runas.exe” -Arguments “$envWinDir\system32\notepad.exe” -IconLocation “$envWinDir\system32\notepad.exe” -Description ‘Notepad’ -WorkingDirectory “$envHomeDrive\$envHomePath”

    PS: Watch out for you posting with slanted quotes and double quotes.

You must be logged in to reply to this topic.