Computing.Net > Forums > Programming > Copying to subdirectorys

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Copying to subdirectorys

Reply to Message Icon

Name: Keola27
Date: September 29, 2007 at 19:30:41 Pacific
OS: 2003server
CPU/Ram: 2.66/2gig
Comment:

I have a web server. I am trying to copy a index.php, to about 400 subfolders. I have used xcopy and robocopy, but i cant seem to figure out how to do it. Any tips or sugestions would rock ^_^



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: September 29, 2007 at 23:47:11 Pacific
Reply:

Tailor the pushd to suit your tree structure.

====================================
:: copy to all directories

@echo off
setLocal EnableDelayedExpansion

pushd c:\files

for /f "tokens=* delims= " %%a in ('dir/s/b/ad') do (
copy c:\somefile "%%a"
)



=====================================
If at first you don't succeed, you're about average.

M2



0
Reply to Message Icon

Related Posts

See More


Picture pop up on start u... batch file for countdown



Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Copying to subdirectorys

Batch to search and copy to new Dir www.computing.net/answers/programming/batch-to-search-and-copy-to-new-dir/16809.html

Copy to 2 Destinations www.computing.net/answers/programming/copy-to-2-destinations/19325.html

Search a local file and copy to a share www.computing.net/answers/programming/search-a-local-file-and-copy-to-a-share/19967.html