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 18.104.22.168.
- 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. 🙂