Searching in cmd
I would like to write a batch file that permits me to search a name in cmd E.g. if I write this command in cmd search c:\new folder a
every file that has a in the name of it must be listed like see saw or something else
Searching in cmd
I would like to write a batch file that permits me to search a name in cmd E.g. if I write this command in cmd search c:\new folder a
every file that has a in the name of it must be listed like see saw or something else
Use dir command. To see what you can do with dir, use dir /? Command
for your example
dir /a-d "C:\new folder\*a*"
Last edited by nitesh14; 02-06-2010 at 03:29 PM.
No actually I would like to create a command not using dir I would like to write a batch file.
Not entirely clear about what you are wanted to complete. If just you want to run the command as a batch, you can just type the same into the batch program and run it.
If you want to hard code the dir
dir /a-d "c:\new folder\*a*"
if you want to supply it as a parameter. In this case enclose the c:\new folder\*s* in the ". Say batch file is test.bat, then run it as test "c:\new folder\*a*"
dir /a-d %1
If you are trying to get the result, you may want to pipe it to a few file, like
dir /a-d "C:\new folder\*a*" > mysearch.txt
Last edited by nitesh14; 02-06-2010 at 03:29 PM.
Bookmarks