Powershell equivalent ?

Welcome Forums General PowerShell Q&A Powershell equivalent ?

This topic contains 1 reply, has 2 voices, and was last updated by

3 years, 9 months ago.

  • Author
  • #28765

    Topics: 48
    Replies: 102
    Points: 0
    Rank: Member

    OK, this has been written in PowerShell but its heavily based on VBS. I was wondering, is there a way to do this in "pure" PowerShell ?

    $WshShell = New-object -comObject WScript.Shell
    $Shortcut = $WshShell.createShortcut("C:\users\$($env:USERNAME)\Desktop\notepad.exe - Shortcut.lnk")
    $Shortcut.TargetPath = "C:\Windows\system32\notepad.exe"
  • #28768

    Topics: 13
    Replies: 4872
    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    Not that I'm immediately aware of. The WScript object does the job so well, nobody on the Windows Shell team has ever bothered creating a .NET-based way of doing it and wrapping a cmdlet around it.

The topic ‘Powershell equivalent ?’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort