Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7559833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:44:13+00:00 2026-05-30T12:44:13+00:00

In DOS I run this command to copy just the directory structure (including subdirectories):

  • 0

In DOS I run this command to copy just the directory structure (including subdirectories):

xcopy c:\sourcedir d:\destdir /T /E

This will copy all subdirectories under sourcedir.

Example these directories exist:

c:\sourcedir 
c:\sourcedir\level1
c:\sourcedir\level2
c:\sourcedir\level2\levelA 
c:\sourcedir\level3
c:\sourcedir\level3\levelB 
c:\sourcedir\level3\levelC

In above command it would create:

d:\destdir
d:\destdir\level1
d:\destdir\level2
d:\destdir\level2\levelA
d:\destdir\level3
d:\destdir\level3\levelB
d:\destdir\level3\levelC

What I only want created is these:

d:\destdir
d:\destdir\level1
d:\destdir\level2
d:\destdir\level3

I am really just looking for a one-liner command. If that can’t be done, I can live with one-liner I have, it just takes 5 minutes instead of the few seconds I was looking for.

Thanks for any help…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T12:44:15+00:00Added an answer on May 30, 2026 at 12:44 pm
    for /d %F in ("c:\sourcedir\*") do md "d:\destdir\%~nxF"
    

    If used in a batch file then double up percents (%%F, %%~nxF)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to run this rar a -rr10 -s c:\backup.rar c:\file.txt DOS command in
I Just wanna to list all files and subdirectories and store this list in
What's the fastest way using either DOS scripting or PowerShell to run this simple
I want to run a DOS command in my C++ program. The point is
If I use Dos command copy to concatenate two files: copy a1.txt + a2.txt
NetFoss requires you to run it with a command line similar to this: nf.bat
I'm using the following line to update a directory via the Windows/DOS command line:
I need to run Dos commands within a class. My problem is that the
My basic problem is that if I run GCC from the windows command line
First some background. I have a batch-type java process run from a DOS batch

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.