Drive Mapping
Technical Document







Using the net use command you can map drives accordingly. In this case the share at \\SHARESERVER\ShareName is mapped to drive G:. Note the escaped backslashes. And the windowstate parameter is set to 'HIDE' to help hide any command prompt as net use is a console application. You can expand on this plus the second example on the How to Use technical document to pass custom/dynamic parameters to the object such a username and password or changing the drive letter to map to. Possibly from a web form if desired.


Drive Mapping Example

<html>
   <script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
   <script language="JavaScript" type="text/javascript"> var $jQuery = jQuery.noConflict(); </script>

   <script type="text/javascript">
   jQuery(document).ready(function()
     {
         jQuery("#link_map").on("click", function (event) 
         {      
           event.preventDefault(); // Recommended to stop the link from doing anything else
           document.dispatchEvent(new CustomEvent('funcIntraLaunch',
           {
            'detail': { task: 'run',
                        program: 'net.exe',
                        switches: 'use G: \\\\SHARESERVER\\ShareName',
                        windowstate: 'HIDE'
                      } })); 
         });
     });
   </script>

   <body>
      <a href="#" id="link_map">Map a Share to G:</a>
   </body>
</html>