On Error Resume Next Dim WSHll Set objWshNetwork = CreateObject( "WScript.Network" ) Set WSHll = CreateObject("WScript.Shell") Set objShell = CreateObject("Shell.Application") MapDrive "I:", "\\servtest2\I", "Share" MapDrive "U:", "\\servtest\U", "U" MapDrive "V:", "\\servtest\V", "V" MapDrive "X:", "\\servtest\X", "MCI" MapDrive "Z:", "\\servtest2\tool$", "Tools" Sub MapDrive(strDrive, strPath, strName) objWshNetwork.RemoveNetworkDrive strDrive, vbTrue, vbTrue objWshNetwork.MapNetworkDrive strDrive, strPath, vbTrue objShell.NameSpace(strDrive).Self.Name = strName End Sub if Err.Number<>0 then Dim fso, tf, oFile, data data = Year(now) & "." & Month(now) & "." & Day(now) Set fso = CreateObject("Scripting.FileSystemObject") Set tf = fso.CreateTextFile("logs\" & data & ".log", True) tf.Write("(" & time & ") ErrorDescription: ") tf.Write(Err.Description) tf.Close MsgBox "Завершено с ошибками! см. logs\" & data & ".log" else MsgBox "Завершено успешно!" end if