Is there a way to set the attributes to hidden

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Knighthammer
Posts: 26
Joined: 05 May 2021 19:05

Is there a way to set the attributes to hidden

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

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

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

Post 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
One of my scripts helped you out? Please donate via Paypal

Knighthammer
Posts: 26
Joined: 05 May 2021 19:05

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

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

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

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

Post 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); }
One of my scripts helped you out? Please donate via Paypal

notabot
Posts: 59
Joined: 24 Feb 2021 12:34

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

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

Knighthammer
Posts: 26
Joined: 05 May 2021 19:05

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

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

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

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

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

Knighthammer
Posts: 26
Joined: 05 May 2021 19:05

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

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

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

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

Post 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...
One of my scripts helped you out? Please donate via Paypal

Post Reply