Announcement

Collapse
No announcement yet.

Trying to Map a Network Drive someone help?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trying to Map a Network Drive someone help?

    Id like to map a network drive once a button is clicked, any ideas how can I do this?

    Thnks
    Dennis

  • #2
    Re: Trying to Map a Network Drive someone help?

    It's not pretty, but this works.

    File.Execute("%SysDir%\Net.exe", "use N: \\computername\sharename",wait)

    ---------Cut and Paste--------------------
    <IR_ACTIONS_LIST>
    <Action name="Execute">
    <Type>8</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <FileName>%SysDir%\net.exe</FileName>
    <CommandLine>use N: \\ComputerName\ShareName</CommandLine>
    <WorkingDir/>
    <RunMode>0</RunMode>
    <WaitForReturn>1</WaitForReturn>
    </Action>
    </IR_ACTIONS_LIST>
    ---------End Cut and Paste -------------------

    Comment


    • #3
      Re: Trying to Map a Network Drive someone help?

      Here's a prettier way to do it using the mpr.dll
      The dll should always be in the system directory and has been included in the OS since win95

      Make sure you change the parameters to your specifications

      14409-Map Drive.zip

      Comment


      • #4
        Originally posted by Buffman
        Is this dll still available? I'm looking to integrate it into a couple tools...

        Many thanks in advance!
        Yes, as Worm mentions above, it is distributed with every Microsoft operating system since Win95. It is located in your (and your user’s) systems folder. In AMS 4 it’s location would be:
        %SysDir%\mpr.dll

        The systems folder is typically located at:
        C:\WINDOWS\system32\

        Comment

        Working...
        X