Jump to content

Recommended Posts

Posted

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
Posted

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

Have a go at coding it yourself - you know where we are if you run into difficulties. ;)

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

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
Posted

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

Array 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

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

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
Posted

Sorcier062,

  Quote

i'm a beginner

We all were at one time. :D

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

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

 

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