This way you can also remove the mapping by specifiying only its remote name. It is then mapped anonymously, only by its remote UNC path. Robocopy.exe "W:\*.* /E /XO /XD "App_Data/Search" "*.svn" /XF "sitefinity.log" "Thumbs.db" /NDL /NC /NPĪs I learned from some researches, you can simply map the share without assigning a drive letter. Net use * \\192.168.0.1\Share\wwwroot\MyProject /user:mydomain\myuser MyP455w0rd Afterwards you can use robocopy to access the share via its UNC path and release any connected share with net use * /delete. If you don't have multiple network shares connected simultaniously, you can make net use * assign a free drive letter for you. "App_Data/Search" "*.svn" /XF "sitefinity.log" "Thumbs.db" /NDL /NC /NP Robocopy.exe "W:\wwwroot\MyProject" x:\ *.* /E /XO /XD Robocopy.exe "W:\/XF "sitefinity.log" "Thumbs.db" /NDL /NC /NP Net use x: \\192.168.0.1\Share\wwwroot\MyProject /user:mydomain\myuser MyP455w0rd This is an example of the batch file: off I don't want to re-use drive letters as they could collide - which would be bad. The problem is that this isn't scalable, it's fine when there are only a few projects but we've now got 20 projects using this approach and are running out of drive letters to map. ![]() Finally the batch deletes the network drive. ![]() Then the batch file calls RoboCopy to deploy the website from the output directory to the destination (and excludes some files and folders). The batch file is used as part of a deployment process I call the batch file from CruiseControl.Net, the batch file needs to map a UNC path which requires credentials to authenticate. ![]() I need to map a network drive with a batch file, but don't want to specify the drive letter.
0 Comments
Leave a Reply. |