Laddy 0 Posted November 23, 2010 (edited) Hello can you help me? why can not I create my shortcut on the desktop? my target is not just $UserName = "Home" $File = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome", "DisplayIcon") $WorkingDir = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome", "InstallLocation") $LinkFileName = @DesktopDir &"\" &$UserName &".lnk" $Icon = "C:\Documents and Settings\Laddy\Desktop\1290536699_Chrome.ico" $Description = "Shortcut Profil User" FileCreateShortcut($File,$LinkFileName,$WorkingDir,$Description,$icon) I think i have a problem with : $File and $ WorkingDir because there are no quotes in the path How do you do ? Thanks a lot for your reply Laddy1290536699_Chrome.ico Edited November 24, 2010 by Laddy Share this post Link to post Share on other sites
MrMitchell 16 Posted November 23, 2010 (edited) Syntax of your FileCreateShortcut() might be the issue...your $Description is where the "args" argument should go, then the $icon is where the $Description is. So try something like this (specify no additional args by using two quotes)... FileCreateShortcut($File,$LinkFileName,$WorkingDir, "" ,$Description,$icon) Hope that helps! Add: Check and double check $File because it appears if that's not valid, then the link won't get created at all. Edited November 23, 2010 by MrMitchell Share this post Link to post Share on other sites
Laddy 0 Posted November 24, 2010 Ah ok. It's ok with : FileCreateShortcut($File,$LinkFileName,$WorkingDir, "" ,$Description,"",$icon) Share this post Link to post Share on other sites