How to connect to Shared Drive/Folder using a net command from MSBuild script?
Today, I gonna share the useful command that how we can connect to the shared drive/folder using a net command from MSBuild script.
- Install the MSBuildTasks package from NuGet package manager. My one is version 184.108.40.206.
- Import the package to your project file.
- Create the new Target to connect to the shared drive/folder.
<Exec Command="net use <drive>\\<servername>\<sharefolder> /user:<username> <password> "
That’s it. I hope this will help. 🙂