PowerShell for Non-N00bs: Creating Shortcuts


$shell = new-object -com wscript.shell


if($name)#create shortcut in same directory


{


     $shortcut = $shell.createshortcut(“c:\” + $name + “.lnk”)


}


Else #create shortcut in specified directory


{


     $shortcut = $shell.createshortcut($source + “.lnk”)


}


$shortcut.targetpath = $source


if($Args -ne “”) #set arguments for shortcut


{


     $shortcut.Arguments = $Args


}


$shortcut.save()

Comments (1)

  1. jayakreasi.com says:

    Thanks.. I’ve tried and it’s work!