Sign in to follow this  
Followers 0
dannyong

FileCreateShortcut Not Working For Windows 7

3 posts in this topic

Hi All

FileCreateShortcut works in Win XP but fails in Windows 7.

Am I missing something or is it a UAC issue?

Appreciate any help on this.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Windows 7 64 bits here (with UAC turned on)... FileCreateShortcut("c:\windows\system32\cmd.exe",@DesktopDir&"\cmdlinkje.lnk") worked immediately here. But trying to create the shortcut in a protected directory like c:\windows,like ConsoleWrite (FileCreateShortcut("c:\windows\system32\cmd.exe","c:\windows\cmdlinkje2.lnk")&@CRLF), failed miserably. That was an UAC issue, because after I put "#requireAdmin" on top of my script it succeeded without a problem. (That is, if I answered the UAC popup to allow the program to do major damage to my system like creating this shortcut... :graduated:)

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

Thanks for sharing your experience, SadBunny.

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