Return Drive name to VBA in Access from batch file
问题 I have a Batch file that maps the next available free drive letter to a network drive. I use this to map a sharepoint site and then use the documents in the shared folder in my Access database. this is the batch file (which works perfectly to map the netwrok) @echo off for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do CD %%a: 1>> nul 2>&1 & if errorlevel 1 set freedrive=%%a: echo %freedrive% pause Net Use %freedrive% "http://XYZ/" pause I call this batch file as a shell from a