Laddy Posted November 23, 2010 Share 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 Link to comment Share on other sites More sharing options...
MrMitchell Posted November 23, 2010 Share 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 Link to comment Share on other sites More sharing options...
Laddy Posted November 24, 2010 Author Share Posted November 24, 2010 Ah ok. It's ok with : FileCreateShortcut($File,$LinkFileName,$WorkingDir, "" ,$Description,"",$icon) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now