There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot browser bsod computer cpu crash css dell desktop driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware missing monitor network networking outlook outlook 2003 outlook 2007 outlook express password popups problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
DOS/PDA/Other
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > DOS/PDA/Other >
Search for file in dos


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
inoutno's Avatar
Junior Member with 6 posts.
 
Join Date: Jan 2006
Experience: Advanced
31-Jan-2006, 03:14 AM #1
Search for file in dos
Greetings!

I am looking for a tool that allow me to search for a speciffic file in DOS, then save the result in an environment variable. The dir/s command would do fine, only, I want it to search not only on the current drive, but through all drives C - Z. Is there any such?

Thanks in advance,
Rockn's Avatar
Computer Specs
Distinguished Member with 17,888 posts.
 
Join Date: Jul 2001
Location: Mexico of the North, MN
Experience: Disenfranchised American Male
31-Jan-2006, 09:16 AM #2
Why not see if the file exists and set the variable based on the resunlts.
inoutno's Avatar
Junior Member with 6 posts.
 
Join Date: Jan 2006
Experience: Advanced
06-Feb-2006, 10:42 PM #3
Thanks for the suggestion, but since I do not necessarily know where the file may be I cannot check if it exists or not. A batch script will do fine I suppose, only, I wanted to make it as simple as possible since I am not the only one who will use it.
Couriant's Avatar
Computer Specs
Distinguished Member with 23,375 posts.
 
Join Date: Mar 2002
Location: Proud Brit in VA
Experience: B.S. in M.I.S
07-Feb-2006, 12:54 PM #4
I haven't have heard of one so I think the batch file will be the way.
StumpedTechy's Avatar
Distinguished Member with 6,142 posts.
 
Join Date: Jul 2004
Location: Central Florida
Experience: Advanced
09-Feb-2006, 09:47 AM #5
Yeah the only thing I can think of is something like this -

@echo off
Echo Please do not close this prompt searching for file
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%a:\file set FILENAME=%%a

this will give you the file wherever its located and set it as the %%a variable.

I don't think a batch file will be bad does the file name change all the time? Also are there multiple copies of this file out there. This can cause other problems too...
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:43 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.