Sign in to follow this  
Followers 0
Briandr

FileCreateShortcut

8 posts in this topic

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.

Share this post


Link to post
Share on other sites



Being run as part of a larger script and running as x64

Share this post


Link to post
Share on other sites

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


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by Briandr

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by Briandr

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by TheSaint

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

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

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