1

I have a exe available on shared drive example "\domain.com\folder\test.exe"

How to access this path using command prompt and execute exe.

I tried "net use y: \domain.com\folder" command. It created network drive but dont know how to execute exe.

Anil
  • 1,669
  • 5
  • 19
  • 44

1 Answers1

1

You can reference the executable directly using a UNC path wrapped in quotes, such as

"\\server\share\path\file.extention"

The \\ at the beginning denotes it's a UNC path wrapping it in quote sis just good practice in case there are any spaces in the path.

"\domain.com\folder\test.exe" will work UNLESS the test.exe file needs to have it's cmd environment local to the program itself because it doesn't properly set itself on run.

in which case you might prefer to use:

MKLINK /D "C:\Link" "\\domain.com\folder"
CD "C:\Link"
test.exe

OR

net use y: "\\domain.com\folder"
CD /D "Y:\"
test.exe

OR

PushD "\\domain.com\folder"
test.exe
PopD

OR

MKLINK /D "C:\Link" "\\domain.com\folder"
MKLINK /J "C:\Junction" "C:\Link"
CD "C:\Junction"
test.exe

I prefer this final method but only because I use some of the features windows enables on junctions in the Explorer details, and does not enable on symbolic links.

Ben Personick
  • 3,074
  • 1
  • 22
  • 29