Jump to content

FileCreateShortcut


Briandr
 Share

Recommended Posts

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

  • Developers

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

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

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

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

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 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)

userbar.png

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...