Page 1 of 1 1
Topic Options
#160555 - 2006-04-08 04:51 PM How Can I copy just a folder structure?
tony01 Offline
Lurker

Registered: 2006-04-08
Posts: 2
Hi Everybody:

I am new to scripting and I need somebody to help me with a script to copy a folder structure,just copy the structure of the folder , no the data.
Example:

-Myfolder
file1
. subfolder1
file2
file3
. subfolder2
file4
. subfolder3
file5
file6

I want to copy just the structure of the folder, removing all the files inside of directories, like this:

-Myfolder
. subfolder1
. subfolder2
. subfolder3

Then, the final result (the folder structure) should be copied to a target direcory, like this.

- MyTargetDir
- Myfolder
. subfolder1
. subfolder2
. subfolder3

Thanks in advance.

Top
#160556 - 2006-04-08 05:05 PM Re: How Can I copy just a folder structure?
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
xcopy /t /e source dest
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#160557 - 2006-04-08 05:16 PM Re: How Can I copy just a folder structure?
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Code:

Shell '%ComSpec% /C XCOPY "D:\MyFolder" "D:\MyTargetDir\" /T /E'


Top
#160558 - 2006-04-08 05:19 PM Re: How Can I copy just a folder structure?
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Whoops Radimus, just waited too long before clicking "Continue"...
Top
#160559 - 2006-04-09 02:58 AM Re: How Can I copy just a folder structure?
tony01 Offline
Lurker

Registered: 2006-04-08
Posts: 2
Guys, excellent soultions, They work very weell.

Thank you very much for your help.

Tony

Top
#160560 - 2006-04-09 10:59 AM Re: How Can I copy just a folder structure?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Also take a look at ROBOCOPY from Microsoft (you can search the board here for it as well)

A very powerful copying utility from Microsoft with many features including what was suggested using XCOPY but so much more as well.

 

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.07 seconds in which 0.039 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org