How to create Symlink without using New-Item (Powershell 3.0)

1.4k Views Asked by At

I am trying to create a symlink object on a user's desktop that points to a directory in the C:\ drive. I have tried using the New-Item cmdlet but Powershell 3.0 and lower does not have the functionality for anything other than files and directories.

The issue is that I am trying to create this script and push it out in a GPO to several computers. Some of these computers are running 32 and 64 bit, some are running Win 7 or Win 10. The majority of them are also running Powershell 3.0 or lower.

Is there an alternative to New-Item for creating symlinks on earlier versions of powershell?

1

There are 1 best solutions below

0
On

You can try this :

C:\WINDOWS\system32>cmd /c mklink y:your/symlink z:your/destination

and if your destination is a repository :

C:\WINDOWS\system32>cmd /c mklink /d y:your/symlink z:your/destination