dannyong Posted November 24, 2010 Posted November 24, 2010 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.
SadBunny Posted November 24, 2010 Posted November 24, 2010 (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... ) Edited November 24, 2010 by SadBunny Roses are FF0000, violets are 0000FF... All my base are belong to you.
dannyong Posted November 25, 2010 Author Posted November 25, 2010 Thanks for sharing your experience, SadBunny.
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