?
Solved

Quick script - to create folders

Posted on 2006-11-30
5
Medium Priority
?
1,304 Views
Last Modified: 2008-01-09
OK Guys

I need to replicate a users problem

to do so I need a script that will generate some folders

top level

1
  |
  |
   ------2
             |
             |
             ---------3

etc etc - all the way to 200 folders deep all nested inside each other

NB Why I'm doing this: A client has a folder like this that he cant delete - Ive told him to use RD /S and Killbox and Gipo Move on boot on the folder - no joy.
   I want to replicate the problem here but I don't want to manually create the folder structure
0
Comment
Question by:Pete Long
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 43

Expert Comment

by:Steve Knight
ID: 18044044
@echo off
c:
mkdir c:\startdir 2>NUL
cd \startdir
for /l %%a in (1,1,200) do mkdir %%a & cd %%a

Try this... goes down to 81 deep for me then fails.
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 2000 total points
ID: 18044065
Suggest a way to get rid of it would be to share part way down the tree then map a drive to it and delete from there?

Shortening it to this:

@echo off
c:
mkdir c:\startdir 2>NUL
cd \startdir
for /l %%a in (1,1,200) do mkdir 1 & cd 1

Creates a directory structure all called 1\1\1\1\1 which allows more to be created... but still not 200
Steve
0
 
LVL 57

Author Comment

by:Pete Long
ID: 18044955
ah 84 folders will do - for now

Basically I wanted to see if

rd /s /q "startdir"

would delete them all and it did (up to 84 folders anyway) the client says his is 200 folders deep - so Im not sure why his WONT work - unless the path is too long for the command interpreter?
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 18045338
I think its the path limit, 255 chars I imagine.  As I suggested try creating a share further down or map a drive to part way down the tree and see if that works but yes the 81/84 seems to work fine!

Good luck

Steve
0
 
LVL 57

Author Comment

by:Pete Long
ID: 18047140
No Probs - Cheers Steve :)
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month11 days, 5 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question