Page 1 of 1

Is there a way to set the attributes to hidden

Posted: 11 May 2021 21:48
by Knighthammer
Greetings,

I largely use XYplorer to more easily manage my server.

I'd like to figure out if there is an "easy" way to set all file types in the attributes to hidden of particular files. I expect this to be a long process as I'm talking about thousands of files in through the file structure.

Does anyone have any advice how to do this?

I'm not opposed to using third party tools if there is an easier option out there.

Thanks in advance.

Re: Is there a way to set the attributes to hidden

Posted: 11 May 2021 22:03
by highend
?

Select them, show the info panel (Menu - Window - Show Info Panel)

Select the "Properties" tab, set your attributes and click the green checkmark once done

Re: Is there a way to set the attributes to hidden

Posted: 11 May 2021 23:06
by Knighthammer
That would cover EVERYTHING.

This is more complicated then that.

I have folders that have files inside that are metadata. NFO, INIs, JPGs/PNGs etc. They are all data that help report or display particular files when browsing the server from the front end.

I want to hide THOSE metadata files without hiding the files they describe.

The usecase is this: there are occasions when I'll want to give someone a copy of the folders and will copy if FROM Windows, but I don't necessarily want the end user I'm giving the folders to to see all the other metadata files unless they are an advanced user who knows what they are looking at.

My easy fix for this, of course, is to simply set everything they don't need to see to hidden since most persons who would be given said folders (with the files in them) would typically not see hidden on their home computer by default.

The file server sets everything to hidden NOW, but there are years upon years of old folders/files that aren't set this way.

I need a tool, script or process that will set everything to hidden for a given set of extensions.

Re: Is there a way to set the attributes to hidden

Posted: 11 May 2021 23:48
by highend
Edit your file extensions in the script, go into the root folder (it will set +h for all of these extensions recursively!) and execute the script...

Code: Select all

    $hideExts = "*.ini;*.nfo;*.jpg;*.png";
    $files    = quicksearch($hideExts, , , "sm");

    // Get only stuff that is NOT hidden atm
    // m = name|size|modified|created|accessed|attributes
    $notHidden = regexmatches($files, "^(.+\|){5}.-", <crlf>);
    // File part only
    $notHidden = regexreplace($notHidden, "\|.+?(?=\r?\n|$)");

    // Set attribute
    if ($notHidden) { attrstamp("h", 1, $notHidden); }

Re: Is there a way to set the attributes to hidden

Posted: 12 May 2021 00:12
by notabot
... or ....
  • Go to the start folder that contain all these files, like c:\movies
  • Start a search (CTRL+F)
  • Name = *.nfo;*.INI;*.jpg
  • Check location; should be your start folder (c:\movies)
  • Press The "Find Now" button
  • Select all files in the Search Results tab
  • Back in the Info panel at the bottom, click the Properties tab
  • Check the Hidden box
  • Click the green check mark
  • Done

BTW: The Attributes UI design has a bug as it should be tri-state:
- checked
- unchecked
- gray or 'square' (= don't change)

Now it is unclear if you unset an attribute or leave that attribute untouched ..

Re: Is there a way to set the attributes to hidden

Posted: 12 May 2021 03:18
by Knighthammer
highend wrote: 11 May 2021 23:48 Edit your file extensions in the script, go into the root folder (it will set +h for all of these extensions recursively!) and execute the script...
Thanks, I haven't gotten into scripting too much with XY yet. I'll give this a shot.

Re: Is there a way to set the attributes to hidden

Posted: 12 May 2021 08:11
by admin
notabot wrote: 12 May 2021 00:12 BTW: The Attributes UI design has a bug as it should be tri-state:
- checked
- unchecked
- gray or 'square' (= don't change)

Now it is unclear if you unset an attribute or leave that attribute untouched ..
Good point, made a note.

Re: Is there a way to set the attributes to hidden

Posted: 13 May 2021 21:11
by Knighthammer
I wanted to come back and give feedback where I was/am.

I tried using the script, but it didn't really give me the results I expected and I think this comes down to my limited understanding of XY Scripts.

I was wondering if you could direct me to a good place to learn how properly setup scripts or expand upon your explanation a bit, because this *IS* an area I'd like to start to pickup more.

That being said, for my usecase, I've found that, surprisingly, XY doesn't get remotely overwhelmed when I do a large search or those files and just mod the attributes. I haven't tried to just do everything in one go, but I have been doing it piecemeal in so far that it gets the job done. I imaged it would have choked, but perhaps its because my server is very beefy, my desktop is very beefy or both (Both are for fact). I guess I over estimated the scope of what I thought XY could handle.

Re: Is there a way to set the attributes to hidden

Posted: 13 May 2021 21:20
by highend
I tried using the script, but it didn't really give me the results I expected
It does what you've asked for, hiding files of a specific type...