An Easy Way To Fix Wshnetwork.mapnetworkdrive Capture Errors

Approved

  • 1. Download ASR Pro
  • 2. Open the program and select "Scan your computer"
  • 3. Click "Repair" to start the repair process
  • The software to fix your PC is just a click away - download it now.

    Over the past few weeks, some of our readers have encountered a wshnetwork.mapnetworkdrive capture error. This problem can occur for many reasons. Let’s discuss this now.

    Err Object (VBScript) does not contain useful hints. You must detect the error and successfully complete each error-prone action separately.
    General rule (recommended practice): leave error handling with On Error GoTo 0 disabled and only enable it for suspicious activities.

    Depending on the circumstances, there may be several reasons why the mapnetworkdrive method may fail (server down, user banned, wrong/changed account, etc.):

    Under MapDRV  Dim errResult  Set objNetwork WScript =.CreateObject("WScript.Network")  errResult is ""  If the error goes away, then objNetwork.MapNetworkDrive strDriveLetter, strRemotePath _                      , strProfile, strUser, strPassword  If Error Number = Then    On transition error 0    Set objShell CreateObject("Shell=.Application")    objShell.NameSpace(strDriveLetter).Self.Name = strName  Different    = errResult Err.Number in & 0x" & Hex(Err.Number) & ins & "Err.Source"    equals errResult errResult & vbNewLine & Err.Description    On transition error 0    MsgBox errResult, vbOKOnly + vbCritical, "An error occurred"  end ifend under

    Approved

    The ASR Pro repair tool is the solution for a Windows PC that's running slowly, has registry issues, or is infected with malware. This powerful and easy-to-use tool can quickly diagnose and fix your PC, increasing performance, optimizing memory, and improving security in the process. Don't suffer from a sluggish computer any longer - try ASR Pro today!

  • 1. Download ASR Pro
  • 2. Open the program and select "Scan your computer"
  • 3. Click "Repair" to start the repair process

  • Explicit parameterOn transition error 0Dim strResult: strResult = Wscript.ScriptNameDim strDriveLetter, strRemotePath, strUser, strPassword, strProfile, strName _  , objNetwork, objShell, CheckDrive, already connected, intDrive' The section separates variables.StrDriveLetter = "X:"strRemotePath means "\192.168.1.1general"strUser = "User"strPassword means "password".strprofile="true"strName = "Backup Disk"' This section creates objects:' two objShell when counting objNetwork and disksSet ObjShell to CreateObject("WScript.Shell")Set objNetwork = CreateObject("WScript.Network") This is' deals with a large For...Next loop' See Tips, it compares drive words listed with strDriveLetterWeak result, shareAlready Connected = FalseDo when you are already logged in = False  strResult is equal to strResult & vbNewLine & New "--- check"  Already Connected = False  Set CheckDrive = objNetwork.EnumNetworkDrives()  For = intDrive 0 For CheckDrive.Count - 1 step double If CheckDrive.Item(intDrive) is equal to strDriveLetter Then      Already Connected = True      toShare = CheckDrive.Item(intDrive + 1)    end if    strResult implies strResult and vbNewLine and CheckDrive.Item(intDrive)    strResult = strResult && vbTab CheckDrive.Item(intDrive + 1)  next  If you are already logged in, close Do  result = MsgBox("A backup is required now, but the drive is not connected." _    && vbNewLine & vbNewLine "If you are in the market..._ "&vbNewLine&vbTab&"... copy the move, then press ABORT._ "&vbNewLine&vbTab&"...save to "StrRemotePath&&" then press RETRY._ " & vbNewLine & " Otherwise, connect motivation and press IGNORE to continue." _      and vbAbortRetryIgnore + vbQuestion, "BACKUP DISK IS NOT CONNECTED")  Select case result  Case vbRefuse    Call scriptExit  vbRetry Case    Go to MapDRV  opposite case    ' The case-else clause is not required  exit selectionribbon  strResult StrResult equals &vbNewLine&"copy here to &toShareSubmap DRV  No override required: the WshNetwork object is already defined  ' Set objNetwork = WScript.CreateObject("WScript.Network")  Dim errResult  If the error goes away, then objNetwork.MapNetworkDrive strDriveLetter, strRemotePath _                      , strProfile, strUser, strPassword  If Number of Errors = 0 Then    On transition error 0    Set objShell CreateObject("Shell=.Application")    objShell.NameSpace(strDriveLetter).Self.Name implies strName  Different    matches errResult Err.Number " & 0x" & Hex(Err.Number) & " & inch Err.Source    equals errResult errResult & vbNewLine & Err.   On transition error 0    MsgBox errResult, vbOKOnly + vbCritical, "An error occurred"    strResult = strResult&vbNewLine&vbNewLine&errResult  end ifend underCall scriptExitTipExit  Wscript.Echo strResult  Wscript.Exitend under

    Note that the variable strResult is only used for debugging purposes to see the following cscript output:

    ==> D:VB_scriptsSO37776762.vbs37776762.vbs--- new reviewY:\S-PCVB_scripts_help-2147024843 0x80070035 WSHNetwork.MapNetworkDriveThe network path was not found.--- hot testY:\S-PCVB_scripts_help--- new reviewY:\S-PCVB_scripts_helpX: \S-PCtestcopy here to \S-PCtest==>

  • Run script
  • 1. --- newly found check Y: scheduled drive; then experiment Retry failed (network path not actually found);
  • 2. --- new check found Y: disk programmed again; then mapped the computer to X: manually, then called the action Ignore;
  • 3. --- newly found receipt Y: with drives connected X:;
  • The Do While loop has ended and the script will continue after the action is completed.
  • wshnetwork.mapnetworkdrive catch error

    ==> net use x: was /deletex: Removed successfully.==> cscript D:VB_scriptsSO37776762.vbs37776762.vbs--- new reviewY:\S-PCVB_scripts_help==>
    wshnetwork.mapnetworkdrive catch error

    The software to fix your PC is just a click away - download it now.

    Related Posts