Computing.Net > Forums > Windows XP > batch file to search

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.

batch file to search

Reply to Message Icon

Name: m00g13
Date: July 30, 2009 at 11:32:24 Pacific
OS: Windows XP
CPU/Ram: N/A
Subcategory: General
Comment:

Hi guys, I think I posted this in the wrong section before. I'm trying to write a batch file to search my C drive for a specific file, and then copy that file to the desktop. For example, if I have a file myFile.ini buried somewhere on the C drive, I'd like the script to find it and copy it to my desktop. Any suggestions?



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: July 30, 2009 at 12:32:33 Pacific
Reply:

Still not the right forum, but whatever.

for /r C:\ %%a in (myFile.ini) do @if exist "%%a" copy "%%a" "%userprofile%\desktop"

0
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 Windows XP Forum Home


Sponsored links

Ads by Google


Results for: batch file to search

Batch File to Search and Replace www.computing.net/answers/windows-xp/batch-file-to-search-and-replace/179474.html

Batch File to search, copy , rename www.computing.net/answers/windows-xp/batch-file-to-search-copy-rename/154130.html

Batch file to search and delete file www.computing.net/answers/windows-xp/batch-file-to-search-and-delete-file/177901.html