General discussion

  • Creator
    Topic
  • #2306852

    Logon Script – Delete Drive

    Locked

    by guy ·

    I am looking for a logon script which will delete a network drive. Language = VBScript. I cannot get the DriveExist command to work. Do you have an example of a script that will make sure a drive letter is deleted before I create a new drive Mapping

All Comments

  • Author
    Replies
    • #3525363

      Logon Script – Delete Drive

      by pweegar1 ·

      In reply to Logon Script – Delete Drive

      If you want to develop your own script, add the net use command to the script. Using net use, you can delete existing drive mappings and/or when you establish a drive mapping, set it’ persistance to no (from a command prompt type net use /? for help)

      • #3536770

        Logon Script – Delete Drive

        by guy ·

        In reply to Logon Script – Delete Drive

        Thanks for your idea, but I am looking for a VBScript command e.g. DriveExist

    • #3534135

      Logon Script – Delete Drive

      by jackofalltech ·

      In reply to Logon Script – Delete Drive

      Since I never use VBS, I don’t know if this will work but, assuming you can DECLARE external routines in VBS, look up either WNetCancelConnection or WNetCancelConnection2 in the Win32 API reference.

      Ralph

    • #3456003

      Logon Script – Delete Drive

      by guy ·

      In reply to Logon Script – Delete Drive

      This question was closed by the author

Viewing 2 reply threads