teunteunteun Posted September 27, 2010 Share Posted September 27, 2010 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 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 27, 2010 Moderators Share Posted September 27, 2010 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 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: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
teunteunteun Posted September 27, 2010 Author Share Posted September 27, 2010 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. M23XP 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? Link to comment Share on other sites More sharing options...
KaFu Posted September 27, 2010 Share Posted September 27, 2010 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") OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
teunteunteun Posted September 27, 2010 Author Share Posted September 27, 2010 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 Link to comment Share on other sites More sharing options...
hessebou Posted October 3, 2010 Share Posted October 3, 2010 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. Link to comment Share on other sites More sharing options...
copyleft Posted November 22, 2017 Share Posted November 22, 2017 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? Link to comment Share on other sites More sharing options...
KaFu Posted November 22, 2017 Share Posted November 22, 2017 (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 November 22, 2017 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) 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