473,387 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Simple Find and Replace Problem! Please help me find a solution!!!

Hello, this is probably nothing to you seasoned guys

I want to search the whole c:\ of a computer to find all instances of a file (i.e test.txt) and replace that file with one from a different location maybe d:\test.txt)

I need to search all subdirectories and evertime I find test.txt replace it with the new one from my D:\

Old school dir test.txt /s finds them all for me, but that's as far as dos seems to go!!!

Please please help I think i'm going mad over this!!!!!!!
Oct 29 '07 #1
1 954
MikeTheBike
639 Expert 512MB
Hello, this is probably nothing to you seasoned guys

I want to search the whole c:\ of a computer to find all instances of a file (i.e test.txt) and replace that file with one from a different location maybe d:\test.txt)

I need to search all subdirectories and evertime I find test.txt replace it with the new one from my D:\

Old school dir test.txt /s finds them all for me, but that's as far as dos seems to go!!!

Please please help I think i'm going mad over this!!!!!!!
Hi

The FileSystemObject.CopyFile method is probably you best bet.

You will need a reference the Microsoft Scripting Runtime to use the FileSystemObjects methods (it has methods to find files, and many more).

MTB

ps. you could use Dir with other methods but FileSystemObject seem to be the in/coming thing!
Oct 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: ddddd | last post by:
How do I place a Command Button on one of my forms that when pressed will open up a find/replace window that I can specify two criterias for search and then have the items I searched for show up on...
4
by: JackRazz | last post by:
I'm trying to use Visual Studio's Find/Replace to match VB declarations. This RegEx works fine in Regulator: ...
2
by: :\\\\derian | last post by:
anyone know where i could find the equivalent of the find / replace windows control for my project? :\\derian
2
by: scorpion53061 | last post by:
This excel find/replace code works great under Excel 2003 but bombs with an error (pasted below the code) in Excel 2000. Can anyone suggest an alternative to make both happy? I am using vb.net...
2
by: Al_P via DotNetMonster.com | last post by:
I have: Win2K Office2000 Working in VB.Net (2003) My .Net project has a reference to Word 9.0 Instantiating things in a simple and straightforward manner: Dim word as Word.Application Dim...
0
by: D Brown | last post by:
Does anyone know why my .NET development would hang / freeze when performing a Global Find / Replace on all files? I have a large ASP.NET VB Application. I have left the machine for 24 hours but...
0
by: vipal.keshwala | last post by:
I just migrated the access data base onto a new server but when I open the application up and click on find/replace in the find what field I try to right click a paste some information, but the...
5
by: peter | last post by:
Hello all, I'm looking for an advice. Example (one block in ascii file): $------------------------ NAME='ALFA' CODE='x' $------------------------
8
by: John Pye | last post by:
Hi all I have a file with a bunch of perl regular expressions like so: /(^|)\*(.*?)\*(|$)/$1'''$2'''$3/ # bold /(^|)\_\_(.*?)\_\_(|$)/$1''<b>$2<\/ b>''$3/ # italic bold...
4
by: Elliot Fraval | last post by:
Hi All, Environment is VBA code in Access 2007. I am having some problems performing a find and replace on text that originates from a memo field in a table. The code is supposed to take...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.