WebMaximus
Contributor
- Sep 26, 2018
- 32
I guess my question isn't really about programming in its true word but more about scripting and how to create a cmd script to create multiple directory junctions using the mklink command.
Here's what I'm trying to achieve:
I have a Temp folder (F:\Temp) containing 736 subfolders called zOrtho4XP_+34+024, zOrtho4XP_+34+025, zOrtho4XP_+34+026 etc ranging all the way to zOrtho4XP_+061+027.
In each of these zOrtho4XP subfolders, I want to create a directory junction called textures that should point to the same zOrtho4XP\textures subfolder located on another disk where the path is E:\Ortho4XP\Tiles\zOrtho4XP_+34+024\textures, E:\Ortho4XP\Tiles\zOrtho4XP_+34+025\textures etc...
I've used the mklink command manually a couple of times to test as seen here:
mklink /H /J F:\Temp\zOrtho4XP_+34+024\textures E:\Ortho4XP\Tiles\zOrtho4XP_+34+024\textures
mklink /H /J F:\Temp\zOrtho4XP_+34+025\textures E:\Ortho4XP\Tiles\zOrtho4XP_+34+025\textures
...
Question is how to automate/script this to avoid having to run this command manually 700+ times and changing the numbers each and every time?
Many thanks in advance for any ideas how and if this can be done!
Here's what I'm trying to achieve:
I have a Temp folder (F:\Temp) containing 736 subfolders called zOrtho4XP_+34+024, zOrtho4XP_+34+025, zOrtho4XP_+34+026 etc ranging all the way to zOrtho4XP_+061+027.
In each of these zOrtho4XP subfolders, I want to create a directory junction called textures that should point to the same zOrtho4XP\textures subfolder located on another disk where the path is E:\Ortho4XP\Tiles\zOrtho4XP_+34+024\textures, E:\Ortho4XP\Tiles\zOrtho4XP_+34+025\textures etc...
I've used the mklink command manually a couple of times to test as seen here:
mklink /H /J F:\Temp\zOrtho4XP_+34+024\textures E:\Ortho4XP\Tiles\zOrtho4XP_+34+024\textures
mklink /H /J F:\Temp\zOrtho4XP_+34+025\textures E:\Ortho4XP\Tiles\zOrtho4XP_+34+025\textures
...
Question is how to automate/script this to avoid having to run this command manually 700+ times and changing the numbers each and every time?
Many thanks in advance for any ideas how and if this can be done!