"Save" method Windows Powershell (windows 7) returns error -


i trying learn how create desktop shortcut using windows powershell can add script several shortcuts deployment of computers @ company. works until $shortcut.save() command.

ps c:\windows\system32> $targetapp = "c:\program files (x86)\mozilla firefox\firefox.exe" ps c:\windows\system32> $wshshell = new-object -comobject wscript.shell ps c:\windows\system32> $shortcut + $wshshell.createshortcut("$home\desktop\firefox.lnk") ps c:\windows\system32> $shortcut.targetpath = $targetapp ps c:\windows\system32> $shortcut.save() 

i using firefox test. when run last line, get:

"exception calling "save" "0" arguments(s): "unable save shortcut "c:\desktop\firefox.lnk".""

the code seems work other people, setting on computer?


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -