Computing.Net > Forums > Disk Operating System > Looking for DOS Command to search a file on C drive

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Looking for DOS Command to search a file on C drive

Reply to Message Icon

Name: FrogHat
Date: December 18, 2000 at 14:22:20 Pacific
Comment:

Does anybody know a command that will find a file on C drive using a DOS/MS-DOS command? It would be nice to locate a file anywhere in C drive and then run that file right away. How do I do that?



Sponsored Link
Ads by Google

Response Number 1
Name: rambler
Date: December 18, 2000 at 14:48:04 Pacific
Reply:

DIR {filename} /S

will search all folders for {filename}


0

Response Number 2
Name: mcpt
Date: December 18, 2000 at 14:50:33 Pacific
Reply:

To search in dos, goto C:\

type

dir/s filename.extension

if you dont know the file extension use filename.*


0

Response Number 3
Name: Michael
Date: December 18, 2000 at 18:45:10 Pacific
Reply:

To find the file and run it make this batch file.

@echo off
if exist %temp%\runfile.bat del %temp%\runfile.bat
dir /b /s notepad.exe > %temp%\runfile.bat
call %temp%\runfile.bat

That's it.
If you do not have a temp directory set in your DOS environment (DOS shell within windows will have one set already) then just add this after the first line

set temp=c:

Hope this helps!
-Michael


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Looking for DOS Command to search a file on C drive

How to rescue my files on C:\ in DOS? www.computing.net/answers/dos/how-to-rescue-my-files-on-c-in-dos/7935.html

I want to hide a file on cd. www.computing.net/answers/dos/i-want-to-hide-a-file-on-cd-/14742.html

is there a dos command to eject a cd? www.computing.net/answers/dos/is-there-a-dos-command-to-eject-a-cd/2678.html