Indexing only File Prperties - windows

I have recently transferred a few files from my external backup disk to my hard drive. I noticed that indexing services were running wild for a long time. I figured out that I had some really large pdf files that windows was trying to ndex.
What I found as a solution was to go to Control Panel->Indexing Options->File Types, locate the .pdf file type and change its filter to "Index properties only". I have later realized that I never in my life had the necessity to search generally a group of files for a specific term. So I went in all file types and changed their filter to "Index properties only".
Is there any way to change the filter to "Index properties only" for all file types without selecting each and changing it manually?

Related

can i make windows file explorer show certain text extracted from files as a new detail column?

I have folders full of log files, and I'd like to display their final status in a column in the folder they are in. That is, in Details view I want to make a new column that shows a piece of text which is extracted from each file. I don't expect to find such a thing out there, and the searches I've tried haven't even yielded a hint about how I would go about writing a plugin to do any such thing. Is it possible?
This sort of thing used to be possible with custom column handler shell extensions but Microsoft removed support for those in Vista (3rd-party Explorer replacements might still support them).
Microsofts inadequate replacement are property handlers. You cannot do this for .log files, you would have to invent a .myapp-log file extension.
Some people abuse the Windows 10 cloud API to create columns but that only works in specific folders.
If you are looking for a specific string in the last line, you could perhaps use a custom icon handler for .log files.

shortcut to files on network share whose name keep changing constantly

There is a network share used as repository in my company and it is quite difficult to navigate through it and find certain files. Some of these files get a new name every day , usually the date changes, which makes it impossible to create shortcuts to them. Usually these are excel or word files. Is there a way I can create a shortcut to that file even though the date has changed on the name of the file?
If you definitely have to use a shortcut (lnk file) for this the only workaround that comes to mind is pointing the shortcut to an environment variable and changing that programatically (wildcards are not supported in lnk files afaik).
However I assume that in most cases what you want is not really a shortcut in its technical definition but rather a way to open the file you want with a double click. In this case it would be a lot easier to just use a simple script that figures out what the name of the file currently is (by whatever rules you use manually) and launch it.
Should be doable in vbscript or powershell (maybe even batch) just fine as long as there is some logical way to determine which file is the right one (e.g. always the current date, always the file where the date is newest, the only file with extension xlsx, ...)

How to script configuring Windows 10 Indexing?

Windows Search is built on Windows Index settings (shown below).
I need to make a powershell script (so everyone here can just run the script to get configured), to :
Add appro dir struct to the list of indexed locations
Set a list of visual studio file types to index file contents
What would such a script look like?
It seems that File Types can be added and changed via the registry.
To add a new File Type and set it to "Properties and File Contents" using "Plain Text Filter", create a key at: Computer\HKEY_CLASSES_ROOT[.extensionYouWantToAdd]\PersistentHandler
Set the (Default) value to
Type: REG_RZ, Data: {5E941D80-BF96-11CD-B579-08002B30BFEB}
I'm not sure, but I'd venture a guess that the GUID specifies that the plain text filter should be used.
I imagine that it is also possible to change the indexed locations in a similar manner.
I figured this out by adding new file types manually and then searching the registry and to find the changes that were made. I have confirmed this works and also found this article that recommends the same technique: https://www.itprotoday.com/windows-78/how-can-i-include-specific-file-type-file-system-search-under-windows-xp
For my case I will be editing the registry via other methods, but it seems this is possible via Powershell also as outlined here: https://blog.netwrix.com/2018/09/11/how-to-get-edit-create-and-delete-registry-keys-with-powershell/
Once you have changed the registry, you will need to tell the index to rebuild. (Covered here: How to rebuild Windows Search Index by using PowerShell?)

NSMetadataQuery with .Trash folder brings no results

I'm trying to implement a class which uses a NSMetadataQuery to find objects within a specified location. I tried it with the user's Downloads folder and the user's .Trash folder. Querying the Downloads folder works find but the query for the .Trash folder always return 0 results (though there are files in it).
I'm creating an NSPredicate with the value of
((kMDItemDisplayName != \"*\"))
and the search scope
/Users/xyz/.Trash
But that doesn't work. Using the search scope
/Users/xyz/Downloads
works fine.
I have read that Spotlight may ignore invisible files. So I created a second predicate with
kMDItemFSInvisible == YES
and combined them both to an NSCompoundPredicate with an "AndPredicateType". But this doesn't work as well (neither works "OrPredicateType").
Does anybody have a clue?
Just to mention: I'm using Swift with Xcode 6 Beta 5, but I think that doesn't matter.
Edit
The reason for this all: I want to find ALL items within a specified folder. I could use NSFileManager... but retrieving file information from it is a pain (incredibly slow when retrieving the attributes file by file).
Depending on Apple's documentation it doesn't seem to be possible to use NSMetadataQuery for querying the Trash folder:
Note: It is important to remember that on OS X, while file-system metadata is available on all volumes, other metadata attributes are not. CDs, DVDs, disk images and System directories are not indexed by Spotlight.

Does Windows cache the contents of .url (Internet Shortcut) files?

I'm implementing a custom URL handler in .NET. To test this, I have created a few different .url files and put them on my Desktop. This generally works fine, but behaves oddly if I change the file's contents, specifically the URL= line. Doing so has no effect — the old URL continues to be opened. Renaming the file, however, works. The file looks like this:
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,0
[InternetShortcut]
URL=myCustomScheme://some/url/pointing/somewhere
IDList=
All shortcuts I create through New → Shortcut receive the same UUID, so changing that probably won't help.
Is there some internal .url file / URL mapping cache in Windows?
I have a reason to believe that URL files are interpreted by some Internet Explorer component at the time of creation (not biblical). They are only interpreted initially, the first time the file is created. Any modifications to the URL file later on will not be committed. This is because the shortcut is not stored in the file. This is why the file can be modified later on so that it becomes empty, as a 0 byte file and the URL file will appear to be working anyway. The shortcut data is stored in the "Web Document" field as a file property in the NTFS file system. The file merely serves the purpose of pointing to it. You might be able to modify these property fields programmatically, which would supposedly "edit the file". It's a painful exercise just to edit what appears to be a simple text file.
Additionally, once a file name has been used for a URL file, it cannot be reused for new files, no matter what disk or path you save it to. So you have to keep assigning unique file names, never used previously, for each new URL file you create. This has to do with how Internet Explorer caches web content. It remembers what file names have been used already and maps those names to previously defined URL addresses. To reuse a name (or when you run out of ideas for new and unique file names) you have to clear Temporary Internet Files.
Windows 7: %localappdata%\Microsoft\Windows\Temporary Internet Files
Windows 8: %localappdata%\Microsoft\Windows\INetCache
To directly answer your question: yes, it does.
Windows 7 Caches your Filenames and sometimes, as you said, the filenames in specific locations.
Start regedit and search for the following
HKEY_USERS\S-1-5-21-x-x-x-x\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache
where S-1-5-21-x-x-x-x is your currently logged in User.
There you can see that most (or all?) files have been cached which you have ever accessed.
Maybe you can also deactivate the MUICaching programatically. Maybe this site helps you: Disable Caching
I had a similar issue, and it turns out the culprit was Firefox.
If by chance your web browser is Firefox, your cache directories may be corrupted.
You can either create a new Profile, or take your chances cleaning things out of C:\Users\<username>\AppData\Local\Mozilla\Firefox\Profiles\<profile>\
I've found my desktop .url shortcut contents cached in %LocalAppData%\Microsoft\Windows\Caches.
There are a few (several?) files with filenames like {<SOME_GUID>}.<x>.ver0x<XXXXXXXXXXXXXXXX>.db. Two of them had the .url files cached.
Unfortunately, I've found no information on what they are or how to refresh them. Everybody just deletes them as part of some cache clean-up operation.

Resources