Re: vbscript: how to generate a FolderItem2 object from a filename ?
Newyana2 <[email protected]>
| Newsgroups | alt.comp.os.windows-xp,alt.windows7.general |
|---|---|
| Organization | A noiseless patient Spider |
| Message-ID | <[email protected]> |
On 6/22/2024 8:42 AM, R.Wieser wrote:
> But just imagine doing that on a folder with *lots* of files, or better yet
> : on a remote computer (with a slow connection) ...
>
I don't see a problem. I just ran it on a folder full of
XP SP2 files. About 480 files. It returned instantly. I also
added Exit For if the file was found. If you run it remotely it's
not going to call back with every loop, so there's no slowdown.
I don't see how you're going to make it simpler. A FolderItem
is part of a collection of what's in a folder. There's no method
like GetFolderItem(path).
A warning, though: Shell.app is connected with Explorer. It's
extremely buggy. On some Windows versions it won't see hidden
files or system files. I just tested the script on System32 and
it didn't work. Apparently Win10 won't let shell.app look in
system32!
The only other thing I can think of that might be cleaner would
be to use a basic file system methods, then maybe read the data out
by direct binary access. Then again, if you want fast then you're
not using VBScript. :) But a more direct method would at least avoid
the funky failures of shell.app. Even FSO works fine in System32
on Win10. I can access a file and check file object properties. But
then you'd need ffmpeg or a binary read or some such to get EXIF
data.