GET-IT: TEAMS DAY | 1-Day Free Virtual Conference all about Teams. Here on Petri.com - 8/12/20 GET-IT: TEAMS DAY - 8/12/20

VBScript On Error Resume

Home Forums Scripting General Scripting VBScript On Error Resume

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    Andy_m
    Member
    #142981

    Hi All

    Just trying to tweak this script, it disconnects a network drive of X:, however I would like it to not give an error or exit if the drive isnt connected yet.

    this script is on logoff and just wanted to check i put the code in the right place

    ####################
    Option Explicit
    Dim objNetwork, strDriveLetter
    strDriveLetter = “X:”

    Set objNetwork = CreateObject(“WScript.Network”)
    objNetwork.RemoveNetworkDrive strDriveLetter
    On Error Resume Next
    Wscript.Quit
    ####################

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.