mklink error in visual studios/webdev

1k views Asked by At

In my webapp i write Process.Start("mklink", args);. This is for testing only and the function has an if to check which os this app is running on (it will be running on my linux server) but i get an exception

The system cannot find the file specified

My mklink is a system file on windows7 and vista. I suspect it isnt finding it because mklink may only be in the admin path.

How do i make it so my program can access mklink?

2

There are 2 answers

0
Toby Meyer On

mklink is built into cmd.exe. You would have to launch cmd.exe to access it. You could do this with cmd.exe /C mklink

where /C = execute command and terminate.

0
Scott Izu On

cmd.exe /C mklink "C:\Users\sizu\fooSymbolic" "C:\Users\sizu\foo"