Sorcier062 Posted December 13, 2011 Posted December 13, 2011 Hello everyone, I used AutoIt and would like to create a script for Customize the Quick Launch shortcut : I search a script for search a file with the full path ex file : Microsoft Office Excel 2003.lnk and put on the file the attributes Hidden Do you have an idea ? Many thanks for your help Christophe
Moderators Melba23 Posted December 13, 2011 Moderators Posted December 13, 2011 Sorcier062,Welcome to the AutoIt forum. Look at the RecFileListToArray UDF in my sig - this will let you find your .lnk file wherever it is on your drive. Then you can use FileSetAttrib to change its attributes. Have a go at coding it yourself - you know where we are if you run into difficulties. 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
Sorcier062 Posted December 13, 2011 Author Posted December 13, 2011 Many thanks Melba23, i tried this and let me know informed ... Christophe
Sorcier062 Posted December 14, 2011 Author Posted December 14, 2011 I try the script and it work correctly but i don't know how to set attribute (Hidden) with the Array : #include<Array.au3> #include"_FileListToArrayEx.au3" $ar_Array = _FileListToArrayEx("c:", "Microsoft Office Excel 2003.lnk", 1, 2) ;_ArrayDisplay($ar_Array, "Liste fichier") ; Ceci est facultatif, c'est juste pour afficher la liste des fichiers. _ArrayDisplay($ar_Array,"Liste fichier") ; Ceci est facultatif, c'est juste pour afficher la liste des fichiers. ;~ MsgBox(1,"Test", $ar_Array) FileSetAttrib($ar_Array, "+H", 1)
Moderators Melba23 Posted December 14, 2011 Moderators Posted December 14, 2011 Sorcier062,What you need to do is to loop through the elements of the array and set the attribute for each one.As you didi nto use my UDF I have no idea about the format of the elements within your $ar_Array - I will assume it is the full path with a count in element [0]:#include"_FileListToArrayEx.au3" ; Find the files $ar_Array = _FileListToArrayEx("c:", "Microsoft Office Excel 2003.lnk", 1, 2) ;Loop through the array For $i = 1 To $ar_Array[0] ; And for each file in the array we set the attribute FileSetAttrib($ar_Array[$i], "+H") ; Do not use 1 here - we do nto want recursion ;) NextArray and loops are fundamental parts of a coders toolbox - you need to learn how to use them. Have you looked at the excellent AutoIt tutorials here and here. There is also an Arrays tutorial in the Wiki that would be worth a look. Good luck. 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
Sorcier062 Posted December 14, 2011 Author Posted December 14, 2011 Wonderful Melba23 Thanks you for your help, it's ok now and sorry for don't use your script, i try it on a new apps ... Many thanks for your link, i'm a beginner ... Christophe
Moderators Melba23 Posted December 14, 2011 Moderators Posted December 14, 2011 Sorcier062,i'm a beginnerWe all were at one time. Those tutorials are very good - I do suggest reading/running them. And you know where we are if you have questions - as long as you have looked in the Help file first! 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
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