Jump to content

[Solved] Filecreateshortcut problem


Laddy
 Share

Recommended Posts

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

Laddy

1290536699_Chrome.ico

Edited by Laddy
Link to comment
Share on other sites

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 by MrMitchell
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...