Jump to content

Recommended Posts

Posted

Hi,

I'm trying to create a shortcut on my desktop automaticly via AutoIt.

This is my code:

FileCreateShortcut ( "C:\Documents and Settings\All Users\Bureaublad\Muppet_Babies_GUI.exe", "C:\Program Files\Muppet_Babies\MuppetBabiesGUI.lnk", "" , "" , "" , "C:\Program Files\Muppet_Babies\BABYKER.ico" , "", "")

The problem is that this command doesnt make the shortcut, is there any other way to create it?

Yours,

Teun

  • Moderators
Posted

teunteunteun,

On my Vista machine, my Desktop shortcuts are stored as "C:\Users\my_user_name\Desktop\file_name.lnk", not in "C:\Program Files". And is the program file really in "C:\Documents and Settings\All Users". :)

Perhaps you have the wrong paths set? ;)

Even if the paths are correct, you may well have problems writing anything to "C:\Program Files", as Vista and Win7 protect that area under UAC. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

  On 9/27/2010 at 1:16 PM, 'Melba23 said:

teunteunteun,

On my Vista machine, my Desktop shortcuts are stored as "C:\Users\my_user_name\Desktop\file_name.lnk", not in "C:\Program Files". And is the program file really in "C:\Documents and Settings\All Users". ;)

Perhaps you have the wrong paths set? ;)

Even if the paths are correct, you may well have problems writing anything to "C:\Program Files", as Vista and Win7 protect that area under UAC. :shocked:

M23

XP is diffrent from Vista I guess.

The paths are right i'm sure, maybe there's just a little error in my codeline, i dont know :S.

I just dont seem to get it working. :)

anybody els any idea on what I should do?

Posted

Give this a try:

$target = "C:\Documents and Settings\All Users\Bureaublad\Muppet_Babies_GUI.exe"
FileCreateShortcut($target, @DesktopCommonDir & "\MuppetBabiesGUI.lnk", StringLeft($target,StringInStr($target,"\",0,-1)) , "" , "Muppet Babies" , "C:\Program Files\Muppet_Babies\BABYKER.ico")
Posted

  On 9/27/2010 at 1:46 PM, 'KaFu said:

Give this a try:

$target = "C:\Documents and Settings\All Users\Bureaublad\Muppet_Babies_GUI.exe"
FileCreateShortcut($target, @DesktopCommonDir & "\MuppetBabiesGUI.lnk", StringLeft($target,StringInStr($target,"\",0,-1)) , "" , "Muppet Babies" , "C:\Program Files\Muppet_Babies\BABYKER.ico")

awesome, ;) thanks so much

love u people @ autoit forum =) allways know the answer

Posted

  On 9/27/2010 at 1:46 PM, 'KaFu said:

Give this a try:

$target = "C:\Documents and Settings\All Users\Bureaublad\Muppet_Babies_GUI.exe"
FileCreateShortcut($target, @DesktopCommonDir & "\MuppetBabiesGUI.lnk", StringLeft($target,StringInStr($target,"\",0,-1)) , "" , "Muppet Babies" , "C:\Program Files\Muppet_Babies\BABYKER.ico")

thanks, your solution also worked for me. never had problems with creating lnk-files, just under vista-64. now all is fine.
  • 7 years later...
Posted

I've got a similar problem that maybe someone can help.

I place a comma in front of my custom startmenu folders so they will always be at the top of the startmenu like this: "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\,Browsers". But autoit doesn't play nice with folders that begin with a comma. I know I could start each folder with an "a" or "x" and achieve the same directory-organizing effect but a comma at the beginning is far less noticeable on the menu. Is there anyway around this since autoit uses commas to separate command statements? 

Posted (edited)

This one works fine for me, although I personally prefer an exclamation mark an and underscore ("!_ImFirst")as the first character to shift folders to the top in a sorting.

; see also
; https://www.howtogeek.com/howto/6463/stupid-geek-tricks-how-to-open-the-start-menu-folder-in-windows-7/
FileCreateShortcut(@AutoItExe, @StartMenuDir & "\'_AutoIt_Test.lnk", "", "", "Link to '_AutoIt", RegRead('HKCR\AutoIt3Script\DefaultIcon', ''))

 

Edited by KaFu

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...