$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()