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?

link|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
feedback

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. ;)

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

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}
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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