Solved .cmd File That Lists Search Results In Open Folder (in XP)

December 26, 2013 at 15:43:37
Specs: Windows XP 64-Bit, Intel Quad/4096
Hey, my question is:

Does there exist such a command that I can put inside a ".cmd" file, (which could be located in C:\), that when I open it, it will re-list that open folder (C:\) to all the folders that contain "asdf" in their name?

I know that there is the option of opening an explorer window (like C:\, for example) and to search for "asdf", then on top, to click on File -> Save Search. See, I want that ".cmd" file to do something very similar to that, yet don't want it to open a new explorer window with the search options on the side waiting for me to click the Search button.

Please help me out, that would be really helpful. Thanks so much!


See More: .cmd File That Lists Search Results In Open Folder (in XP)

Report •


✔ Best Answer
December 27, 2013 at 21:48:35
It's going to be a text file because that's what the results will be. Using my example above you can send it to the desktop with something like:

dir c:\*.exe > "c:\documents and settings\username\desktop\abcd.txt"

message edited by DAVEINCAPS



#1
December 26, 2013 at 16:57:14
go to a cmd prompt and type dir /?

See if that doesn't fit your requirement

Answers are only as good as the information you provide.
How to properly post a question:
Sorry no tech support via PM's


Report •

#2
December 26, 2013 at 17:32:13
? no... I want to open a *.cmd file, (for example asdf.cmd), and have this do commands that would re-list that explorer window as certain results.

Report •

#3
December 26, 2013 at 19:59:36
If you're going to run a search from a .cmd or .bat file your options are limited. You can't just search for a file with 'asdf' in its name. You can search for files named asdf by searching for asdf.* or for example search for a seven character file starting with asdf--asdf???.*. That is, you have to specifiy where in the file name asdf is. The question marks are called wild cards and mean that any character can be there. The * means all names so for example *.* means all files and all extensions.

But lets say you get that figured out. You can send all the search results from the DIR command to another file. For example, this command sends all the names of all the files with an .exe extension on the root drive--c:\--to a file named abcd.txt
dir c:\*.exe > abcd.txt in the default folder.

That's just some basic stuff and there are some technical differences between .bat and .cmd files that I'm not up on. And I'm not even sure that is what you wanted to know.

You might want to look into batch file commands and maybe repost in the programming forum for additional help.


Report •

Related Solutions

#4
December 27, 2013 at 16:02:18
Thank you for the replies, and yes, I posted it at: http://www.computing.net/answers/pr...

Also, sorry for being unclear, I don't want the results in a text file, I want them in an explorer window


Report •

#5
December 27, 2013 at 21:48:35
✔ Best Answer
It's going to be a text file because that's what the results will be. Using my example above you can send it to the desktop with something like:

dir c:\*.exe > "c:\documents and settings\username\desktop\abcd.txt"

message edited by DAVEINCAPS


Report •

Ask Question