mklink

How to run windows command “mklink” from vb.net application?

青春壹個敷衍的年華 提交于 2019-12-06 05:03:37
I want to be able to run "mklink path1 path2" from my vb.net project. I fail to do that. I have tried with Shell() function and with Process. With this it only open cmd.exe window and does nothing: Dim process As New Process process.StartInfo.FileName = "cmd.exe" process.StartInfo.Arguments = "mklink """ + arma2oaAddons + """ """ + arma2Addons + """ /j" process.StartInfo.WorkingDirectory = "C:\" process.Start() And with this I get error "File not found". It can't find mklink.: Shell("mklink """ + arma2oaAddons + """ """ + arma2Addons + """ /j") What is mklink? Mklink is a MS Windows command

What the C# equivalent of “mklink /J”?

荒凉一梦 提交于 2019-12-03 04:08:36
问题 I know how to create a symbolic link in windows in a .bat script: mklink /J <LinkPath> <OriginalResourcePath> How to do the same thing in C# ? I've not been happy with the googling, because i'm a beginner in C# and I probably don't use the right terms. Anybody can indicate the API to use please ? 回答1: Here's a code example: using System.Runtime.InteropServices; using System.IO; namespace ConsoleApplication { class Program { [DllImport("kernel32.dll")] static extern bool CreateSymbolicLink(

What the C# equivalent of “mklink /J”?

*爱你&永不变心* 提交于 2019-12-02 17:28:47
I know how to create a symbolic link in windows in a .bat script: mklink /J <LinkPath> <OriginalResourcePath> How to do the same thing in C# ? I've not been happy with the googling, because i'm a beginner in C# and I probably don't use the right terms. Anybody can indicate the API to use please ? Christophe Geers Here's a code example: using System.Runtime.InteropServices; using System.IO; namespace ConsoleApplication { class Program { [DllImport("kernel32.dll")] static extern bool CreateSymbolicLink( string lpSymlinkFileName, string lpTargetFileName, SymbolicLink dwFlags); enum SymbolicLink {