Sign in to follow this  
Followers 0
Laddy

[Solved] Filecreateshortcut problem

3 posts in this topic

#1 ·  Posted (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

Laddy

1290536699_Chrome.ico

Edited by Laddy

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by MrMitchell

Share this post


Link to post
Share on other sites

Ah ok. It's ok with :

FileCreateShortcut($File,$LinkFileName,$WorkingDir, "" ,$Description,"",$icon)

Share this post


Link to post
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
Sign in to follow this  
Followers 0