How to create the shortcuts of several folders with a script?

Hello, I have this problem and I would like to automate it through a script, so that it simplifies a job that until now I do manually.
I have at least 3 folders on 3 different hard drives (everything does not fit on a single drive), which in turn contains many folders, every week the number of them is updated and increases. Which I need all grouped in a single folder. The solution that I could give and I’m not very satisfied with it, is creating direct access to the folders and grouping them into one. There are more than 800 folders and I do it weekly deleting all the old ones and selecting them all and dragging and dropping I choose “Create shortcut icons here” I repeat the above on disk 2 and then on disk 3.
Question 1
Can you create a script which will run and recursively walk through the folder and create a shortcut for each folder?
Question 2
Is there another way to join the contents of folders on different hard drives virtually other than by making a RAID?

Dany,
Welcome to the forum. :wave:t3:

I’m unsure how I should understand this question. Are you asking if we could or are you asking if it’s possible? :wink:

Please keep in mind … this forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.

What have you tried so far? We expect you to make an own attempt to get your task done or to solve your problem. If you have done so already please document here what exactly you have done and show your code. Then we probably might be able to help you step further.

Regardless of that - usually you’re not the very first one with a given task. Most common tasks have been accomplished several times before and even have been published to help others with the same or a similar task. So it’s pretty likely that you find code online you can adjust easily to your particular needs. Search for it. :+1:t4:

Whatfor? Why do you need them this way? You may elaborate a little more detailed about “the big picture”. Ther emight be a better way. :wink:

If these drives are local drives you can mount them in an empty folder on your C: drive (or any other existing drive) just like it is normal on Linux or Mac machines.

(First of all, excuse me if you don’t understand very well what I write because I speak Spanish and I’m using Google translate)
Yes, I need to know if it is possible to make a script that recursively traverses all the contents of a folder and makes a shortcut of each subfolder and stores them in a different folder. I’ve found some code on the internet, but I’m not sure that a script or BAT can be used for this purpose.
folder

There are no files in the folders on each disk, at least on the first level. I don’t need to create shortcuts from other levels, just from the first one.

There are three 8TB drives completely full, in the subfolders there are video files, I can’t put everything in one folder because there is not enough space and I don’t want to join the drives in a RAID, I already tried to mount the three drives in one folder in c: and it does not solve the problem because all the subfolders are not together. I also tried the mklink command but it didn’t work as it is used more to sync the folders and only supports one. So far, the best solution is with the shortcuts solution, I need all the subfolders together to make my work more productive. It only has the drawback that I have to update the shortcuts at least weekly.

Yes, that would be possible with PowerShell. But if you’re not familiar with a programming or scripting language I wouldn’t recommend using it. It is not recommended to use code you don’t understand. :man_shrugging:t3:

Why not? If that’s the way to make you more productive … :man_shrugging:t3: a RAID or a Windows Storage Spaces pool offers the opportunity to join more than one drive and makes the combined space easier usable.

Making a RAID at this point has many drawbacks. First, you can’t RAID data on the hard drive, I lose all data. I have 55TB in total on the PC, I would have to buy several hard drives that at least add up to this amount and it is very expensive in the country I live in. Second, if a RAID disk breaks I have a risk of losing all the information, on the contrary, if the disks are kept separate, only the information on that disk will be lost, unless I make a RAID 5 which has loss protection. of data due to breakage, but at the cost of doubling the data and I need twice as many disks, another very expensive solution.

That’s right. But it would be an investment in the future.

That’s right as well.

That’s a lot of storage. But it sounds like you’re using this professionally, don’t you? If that’s the case shouldn’t your equipment be appropriate to the job you have to do to be able to deliver a professional result?

Hmmm … may I mention the topic backup? Even for my “privat patients” and family members I have to support I used to say “No Backup - No Excuse”.

That’s actually not right. You may take a look at a RAID calculator to determine the amount of space you need.

Anyway … In the end, it’s up to you to decide whether you want to work with a professional solution or a tinkered one.

OK … back to topic … we’re in a PowerShell forum. :wink:

As I said earlier - yes you can do what you’ve asked for. But we will not write the code for you here in this forum. You have to do it yourself or pay an IT professional to do it for you. :man_shrugging:t3:

I agree with Olaf

RAID != Backup

55TB is a TON of data. If the data is critical, you really need a backup solution. But I digress … sorry for the off topic post.

I agree with you but for now I can’t :money_mouth_face: :unamused:

You are right, according to the calculator for 55 TB I need 8 hard drives of 8TB and not double the space, the calculator is very useful, thanks

Thank you very much for the help :fist_right: :fist_left:, I will continue studying to make the script in powershell, for the moment I found a friendlier way to make the shortcuts with Total Commander. And in the future maybe I can do the RAID which is the solution to my problem :blush:

thanks for the comment :+1: :blush:

In the vast majority of the cases you’re not the very first one with a given task. Really often you can find an almost fitting solution you can easily adapt to your particular needs. You don’t have to re-invent the wheel again. :point_up_2:t3: :wink:

This would be fairly easy.

Get all the directories you want shortcuts for.

$Directories = Get-ChildItem -Path "C:\root\directory" -Directory -Recurse

Create shortcut for each

$WShell = New-Object -comobject Wscript.Shell

foreach($dir in $Directories) {
    $Shortcut = WShell.CreateShortcut("FullPathWhereShortcutGoes\shortcutname.lnk")
    $Shortcut.TargetPath = "$($dir.FullName)"
    $Shortcut.Save()
}

The thread was too long, I did not read it all, but I think symbolic links is what you are looking for.
To the system, are considered as regular folders, when .lnk are considered as files.
You can have subfolders that look like local folders, but in fact, will query another drive, or even a CIFS shared folder.

Here are the key words, you can now look for online documentation

New-Item -ItemType SymbolicLink