Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to make three levels of folders each numbered 0-9 so that I can access files/1/2/3/123456.jpg

mkdir {1,2,3,4,5,6,7,8,9,0}/{1,2,3,4,5,6,7,8,9,0}/{1,2,3,4,5,6,7,8,9,0} 

doesn't work.

I don't have SSH access to this Linux web server, so how would I go about doing this in Windows?

share|improve this question
1  
If you don't have SSH access, what protocol are you using then? –  Tom Wijsman Aug 15 '10 at 18:09
    
ftp and svn. I'm trying to create the folders locally on my windows development box. –  The Digital Ninja Aug 15 '10 at 18:18
    
Could you please be a little clearer? Are you attempting to make the folders on a Windows or a Linux machine? –  EvilChookie Aug 15 '10 at 18:34
add comment

2 Answers

up vote 2 down vote accepted

I think the mkdir command above can be simulated with a .bat-file. It's been a while since I last had to write .bat-files and I don't have any windows machine to test it on, but something like this should work (may need tweaking):

for /L %%f in (0,1,9) do (
  md %%f
  cd %%f
  for /L %%g in (0,1,9) do (
    md %%g
    cd %%g
    for /L %%h in (0,1,9) do (
      md %%h
    )
    cd ..
  )
  cd ..
)

As suggested by grawity, it can also be written like this since "md" should work like "mkdir -p":

for /L %%f in (0,1,9) do (
  for /L %%g in (0,1,9) do (
    for /L %%h in (0,1,9) do (
      md %%f/%%g/%%h
    )
  )
)

Or you could start working on a linux box instead, where everything is so much easier. ;)

share|improve this answer
    
md %%f/%%g/%%h –  grawity Aug 15 '10 at 20:44
add comment

It is not clear from your question if you can execute commands on the remote server; if you can, add the -p switch to mkdir command to make it work.

$ mkdir -p {1,2,3,4,5,6,7,8,9,0}/{1,2,3,4,5,6,7,8,9,0}/{1,2,3,4,5,6,7,8,9,0}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.