I have the below batch file that remaps an existing Y: drive remote shared folder to another freely available drive letter, and then disconnects Y: drive and remaps it to my chosen remote folder or local folder.
But i don't know how to convert this batch code into a VBA function i.e. similar to below shown function. I am mainly having problems with the double-quotes in `sCMD` string.
Any help would be most appreciated.
What the batch commands do is :
See if the concerned Drive e.g. Y: is available or not.
If in use, assign Y:'s network path to the next freely available drive.
Disconnect (delete) Y:
Assign Y: to concerned Directory (Local or Remote).
So need the `sCMD` properly double-quoted inorder to make it work!
Here is the function:
And here is the actual Batch code i wrote which works. Please note there is no error handling code to handle if all free drives are exhausted. If someone can also help with that, that would be useful for everyone :
http://www.vbaexpress.com/forum/show...o-VBA-Function
Bookmarks