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 script to search/copy/replace
Name: ckltd740 Date: July 8, 2008 at 17:31:03 Pacific OS: Windows XP CPU/Ram: NA Product: Dell/D630
Comment:
All, I'm looking for assistance with putting together a batch file to be loaded at logon or system startup that will:
1)Search the local C drive for an exact file path/folder 2) Write the search results to a log file to review both successful and unsuccessful hits by PC hostname 3) Terminate when search is unsuccessful, but continue for successful hits 4) Copy/Move folder contents to a backup folder 5) Copy another set of files to the target folder to replace previous files
I need this script to execute ONLY for successful search hits. I plan to use Active Directory Services for Windows Server 2003 to push this batch file out to an OU containing Windows 2000/XP target machines.
Any leads or ideas would be most appreciated. Thanks.
Name: ckltd740 Date: July 8, 2008 at 19:39:40 Pacific
Reply:
I did find a post similar to what I need, but need to find a way to prefix that script with the required local C drive search string and logfile update I need. Post I'm referencing is titled "batch file to copy and move certain" on this site.
ckltd740
0
Response Number 2
Name: Mechanix2Go Date: July 8, 2008 at 22:48:41 Pacific
Reply:
@echo off setLocal EnableDelayedExpansion
for /f "tokens=* delims= " %%a in ('dir/s/b/a-d c:\somefile') do ( if errorlevel 1 goto :eof echo move %%a c:\bakup echo copy c:\newstuff %%~Pa )
===================================== If at first you don't succeed, you're about average.
M2
0
Response Number 3
Name: ckltd740 Date: July 9, 2008 at 09:12:51 Pacific
Reply:
Thanx M2Go. This looks good; we'll give it a go and check the result.
Summary: I found a batch script to search all drives and delete the autorun.inf file on this forum I want that method but change it up a bit. I would like to Search all drives for a specific file and copy the ...
Summary: I need a batch file to search a bunch of sub folders. The following is an example: main\sub1\new main\sub2\new main\sub3\new etc I need to search all the 'new' folders for files. If any are found then...
Summary: I would like to make a batch script to find my external ip address then upload it via ftp to a free website I have. The purpose being so I could find out my ip address to ftp home while I'm away, just...