Briandr Posted November 6, 2014 Share Posted November 6, 2014 Hi, I am having issues with FileCreateShortcut on Windows 7 64-bit. One line works and the other one does not. If Not FileExists( @StartMenuDir & "ProgramsAccessoriesSystem ToolsTrace 32.lnk" ) Then FileCreateShortcut ( "C:\Windows\System32\trace32.exe", @StartMenuDir & "ProgramsAccessoriesSystem ToolsTrace 32.lnk" ) (Line above Ok) If Not FileExists( @StartMenuDir & "ProgramsCiscoCisco AnyConnect VPN Client.lnk" ) Then FileCreateShortcut ( "C:Program Files (x86)CiscoCisco AnyConnect VPN Clientvpnui.exe", @StartMenuDir & "ProgramsCiscoCisco AnyConnect VPN Client.lnk" ) (Line above not Ok) The folders off the programs menu get created fine. Any ideas? Thanks. Link to comment Share on other sites More sharing options...
Developers Jos Posted November 6, 2014 Developers Share Posted November 6, 2014 How are you running this and are you using the 32 or 64 bits version of Autoit3? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Briandr Posted November 6, 2014 Author Share Posted November 6, 2014 Being run as part of a larger script and running as x64 Link to comment Share on other sites More sharing options...
Developers Jos Posted November 6, 2014 Developers Share Posted November 6, 2014 You say that it isn't working, but what exactly is not working? What is the Return code and @error returned from the FileCreateShortcut? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Briandr Posted November 6, 2014 Author Share Posted November 6, 2014 (edited) Right now its not logging for a return code. I will try and set that up (still new to Autoit). I am just wondering if Program Files (x86) and the extra '( )' could be causing problems. Maybe I need an environmental variable, but this only for x64 systems. Edited November 6, 2014 by Briandr Link to comment Share on other sites More sharing options...
Briandr Posted November 6, 2014 Author Share Posted November 6, 2014 (edited) Found my own answer: If Not FileExists( @ProgramsCommonDir & "ProgramsCiscoCisco AnyConnect VPN Client.lnk" ) Then FileCreateShortcut ( "C:Program Files (x86)CiscoCisco AnyConnect VPN Clientvpnui.exe", @ProgramsCommonDir & "CiscoCisco AnyConnect VPN Client.lnk" ) Thanks to all who previously offered suggestions Edited November 6, 2014 by Briandr Link to comment Share on other sites More sharing options...
Briandr Posted November 12, 2014 Author Share Posted November 12, 2014 Hi, I been reading the help file on FileCreateShortcut and am still confused on where to specify the path to the .ico file. Can someone point that out using the above example. For this example my.ico resides in the same folder, not in a windowssystem32 folder. Thanks. Link to comment Share on other sites More sharing options...
TheSaint Posted November 12, 2014 Share Posted November 12, 2014 (edited) The Help file is pretty clear. The sixth parameter is where you specify the full path (including filename), and the 8th parameter is where you specify the icon number (usually 0 or 1, unless the icon file has many icons in it ... as they are all numbered). Both those parameters need to be correct. Edited November 12, 2014 by TheSaint Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) 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