How to use UNC paths inside Windows Command prompt?

If you are reading this article which means you want to open a UNC path from the command prompt. Yes I also wanted to play with some UNC paths just before write this article.

How to use UNC paths inside Windows Command prompt?

I thought it will be good if I share that knowledge with you.

It’s easy just use “pushd” without quotes in front of the UNC path you want to use. This little command will assign your location as a temporary network location and will treat the location as a drive. To remove the network drive assignment you need to place “popd” at the end of the script.

pushd \\Server\my_share

          #Rest
          #of
          #the
          #script

popd 

How to use UNC paths inside Windows Command prompt?

Hope this helped.

Like this post? Please share to your friends:
Leave a Reply

;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: