Help with search

General questions about NeoBook

Moderator: Neosoft Support

Locked
StarterPack
Posts: 127
Joined: Fri Feb 19, 2016 6:55 am

Help with search

Post by StarterPack »

Hi guys, I want to search for all my .jpg "Jpeg" files on my C or D drive etc. including in all folders and display it in "Listbox" with path
Any help please
User avatar
Gaev
Posts: 3782
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada
Contact:

Re: Help with search

Post by Gaev »

StarterPack:

1) First, try this in your Command Window ...

Code: Select all

dir c:\*.jpg /s  /b
2) if the resulting response is what you want, do this from your NeoBook application (using the Run command) ...

Code: Select all

dir c:\*.jpg /s  /b > c:\ListOfAllJpgFiles.txt
3) And follow this the Run command with commands to load the contents of this file into a NeoBook variable ... one which is specified for the "List Items" property of your ListBox/ComboBox e.g. ...

Code: Select all

FileRead "!c:\ListOfAllJpgFiles.txt" "All" "[ListBox1Items]"
Note: make sure you specify the "Wait" option with the Run command, so the FileRead command will only be serviced after the dir command has done its job.
StarterPack
Posts: 127
Joined: Fri Feb 19, 2016 6:55 am

Re: Help with search

Post by StarterPack »

Hi Gaev
Thank you for your reply. Exactly what I needed.
I Just change my .bat file to
"dir c:\*.jpg /s /b | findstr /v .jpg. > JPegFiles.txt"

I'm happy now....... Thank You!
Tony Kroos
Posts: 419
Joined: Thu Oct 15, 2009 3:43 pm

Re: Help with search

Post by Tony Kroos »

Just one thing - do not use files for output. You may not have enough privileges to write on disk, e.g. root folders, etc...
Copy output directly to clipboard with | clip

Code: Select all

Run "dir" "d:\temp\*.jpg /s  /b | clip" "RunOnce+Wait+Hidden" "" ""
AlertBox "" "[Clipboard]"
ClearVariables "[Clipboard]"
User avatar
Gaev
Posts: 3782
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada
Contact:

Re: Help with search

Post by Gaev »

Tony Kroos:

I just used the target/container file name as an example ... users can specify [TempDir] or [PubDir] or any other location.

But the idea of using the Clipboard is a much better choice than using a file as an interim store ... didn't know the clip command existed ... note that ...
The clip.exe command file comes standard with Windows Server 2003, Windows Vista, and newer versions of Windows. It does not come standard with earlier versions of Windows such as Windows XP.
But if you are using one of the supported versions of Windows, you can use this command with many other commands e.g. dir, tree, type, sort, find, findstr, ftype ... to name just a few.

Thanks for sharing !!!
Locked