Skip to main content

Powershell Symbolic Links in Windows 10

A chain is only as strong as its weakest link.
— Anonymous.

Hey guys, recently I’ve been using more the Powershell1 prompt rather than the old command prompt2. Both command consoles can still be run on Windows 10, but on recent occasion I prefer the Powershell as you can use it to create more complex shell scripts on Windows and access some C# modules.

On my previous recent post about moving ProgramData to another drive, I’ve use the mklink utility to create junction directory to-and-from. So here are the equivalent commands:

Command Prompt Syntax Powershell Equivalent Syntax
mklink Link Target New-Item -ItemType SymbolicLink -Name Link -Target Target
mklink /D Link Target New-Item -ItemType SymbolicLink -Name Link -Target Target
mklink /H Link Target New-Item -ItemType HardLink -Name Link -Target Target
mklink /J Link Target New-Item -ItemType Junction -Name Link -Target Target

The New-Item command is also analogous to Unix touch command tool.
Check the definition first of those commands before running on your system.
That’s all guys!

Leave a comment if you have questions and queries. Also you can DM me on twitter 😉.

💻


  1. PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and the associated scripting language. Initially a Windows component only, known as Windows PowerShell, it was made open-source and cross-platform on 18 August 2016 with the introduction of PowerShell Core. ↩︎

  2. The name refers to its executable filename. It is also commonly referred to as cmd or the Command Prompt, referring to the default window title on Windows. The implementations differ on the various systems but the behavior and basic set of commands is generally consistent. cmd.exe is the counterpart of COMMAND.COM in DOS and Windows 9x systems, and analogous to the Unix shells used on Unix-like systems. ↩︎

Comments

Popular posts from this blog

Disable mDNS and SSDP Discovery in Google Chrome

We're born alone, we live alone, we die alone. Only through our love and friendship can we create the illusion for the moment that we're not alone. — Orson Welles.

Top Three DNS Providers That Provides Good Service in SEA (Southeast Asia)

If you give a hacker a new toy, the first thing he'll do is take it apart to figure out how it works. — Jamie Zawinski.

Gimp Automating Image Processing with Python Fu

What a large volume of adventures may be grasped within the span of his little life by him who interests his heart in everything. — Laurence Sterne.

Flutter Series - Custom Icons

Everyone thinks of changing the world, but no one thinks of changing himself. — Leo Tolstoy.