Vbscript 尝试绑定到AD用户对象时出现错误2147463168

Vbscript 尝试绑定到AD用户对象时出现错误2147463168,vbscript,active-directory,ldap-query,Vbscript,Active Directory,Ldap Query,我正在使用Windows 2012(不是R2,无法升级)广告环境。当我使用管理员(而不是管理员)帐户从vbscript运行以下代码时,它运行得非常好。然而,当我用普通用户运行它时,我得到一个-2147463168,这似乎是一个绑定错误 On error Resume next UsuariosLDAP = "LDAP://" & objSysInfo.UserNameSet ObjUser = GetObject(UsuariosLDAP) If err.number <>

我正在使用Windows 2012(不是R2,无法升级)广告环境。当我使用管理员(而不是管理员)帐户从vbscript运行以下代码时,它运行得非常好。然而,当我用普通用户运行它时,我得到一个-2147463168,这似乎是一个绑定错误

On error Resume next
UsuariosLDAP = "LDAP://" & objSysInfo.UserNameSet
ObjUser = GetObject(UsuariosLDAP)
If err.number <> 0 then
    strTipoError = "Error buscando objeto en LDAP " & CStr(Err.Number) & " Usuario:" &    objSysInfo.UserName
    shell.logevent 1, strTipoError 
    Wscript.Quit
end if    
出错时继续下一步
UsuariosLDAP=“LDAP://”&objSysInfo.UserNameSet
ObjUser=GetObject(通常为SLDAP)
如果错误号为0,则
strTipoError=“Error buscando objeto en LDAP”&CStr(Err.Number)&Usuario:&objSysInfo.UserName
shell.logevent 1,strpoerror
Wscript.Quit
如果结束
由于它使用管理员帐户正常运行,我将假设(寻找其他选项),这是一个权限问题。问题是,这是一个由所有用户执行的登录脚本,所以我对修改所有广告对象的权限有点谨慎,除非我真的必须这样做。另一件事是,我以前做过几次类似的事情(用普通用户查询UserObject),它总是正常工作。我不确定2012年发生了什么变化来打破这一局面

提前很多时间

// MessageId: E_ADS_BAD_PATHNAME
//
// MessageText:
//
//  An invalid directory pathname was passed
//
#define E_ADS_BAD_PATHNAME               _HRESULT_TYPEDEF_(0x80005000L)
来自ADSErr.h

解码错误

Code Message 
01 Invalid function number 
02 File not found 
03 Path not found 
04 Too many open files (no handles left) 
05 Access denied 
06 Invalid handle 
07 Memory control blocks destroyed 
08 Insufficient memory 
09 Invalid memory block address 
0A Invalid environment 
0B Invalid format 
0C Invalid access mode (open mode is invalid) 
0D Invalid data 
0E Reserved 
0F Invalid drive specified 
10 Attempt to remove current directory 
11 Not same device 
12 No more files 
13 Attempt to write on a write-protected diskette 
14 Unknown unit 
15 Drive not ready 
16 Unknown command 
17 CRC error 
18 Bad request structure length 
19 Seek error 
1A Unknown media type 
1B Sector not found 
1C Printer out of paper 
1D Write fault 
1E Read fault 
1F General failure 
20 Sharing violation 
21 Lock violation 
22 Invalid disk change 
23 FCB unavailable 
24 Sharing buffer overflow 
25 Reserved 
26 Unable to complete file operation (DOS 4.x) 
27-31 Reserved 
32 Network request not supported 
33 Remote computer not listening 
34 Duplicate name on network 
35 Network name not found 
36 Network busy 
37 Network device no longer exists 
38 NetBIOS command limit exceeded 
39 Network adapter error 
3A Incorrect network response 
3B Unexpected network error 
3C Incompatible remote adapter 
3D Print queue full 
3E No space for print file 
3F Print file deleted 
40 Network name deleted 
41 Access denied 
42 Network device type incorrect 
43 Network name not found 
44 Network name limit exceeded 
45 NetBIOS session limit exceeded 
46 Temporarily paused 
47 Network request not accepted 
48 Print or disk redirection is paused 
49-4F Reserved 
50 File already exists 
51 Reserved 
52 Cannot make directory entry 
53 Fail on INT 24 
54 Too many redirections 
55 Duplicate redirection 
56 Invalid password 
57 Invalid parameter 
58 Network device fault 
59 Function not supported by network (DOS 4.x) 
5A Required system component not installed (DOS 4.x) 
NTStatus Facilities  HResults Facilities  
Common status values 0x0 Null 0x0 
Debugger 0x1 Rpc 0x1 
Rpc_runtime 0x2 Dispatch 0x2 
Rpc_stubs 0x3 Storage 0x3 
Io_error_code 0x4 Itf 0x4 
Various drivers 0x5-0xf Win32 0x7 
Ntwin32 0x7 Windows 0x8 
Ntsspi 0x9 Sspi 0x9 
Terminal_server 0xa Security 0x9 
Faciltiy_mui_error_code 0xb Control 0xa 
Usb_error_code 0x10 Cert 0xb 
Hid_error_code 0x11 Internet 0xc 
Firewire_error_code 0x12 Mediaserver 0xd 
Cluster_error_code 0x13 Msmq 0xe 
Acpi_error_code 0x14 Setupapi 0xf 
Sxs_error_code 0x15 Scard 0x10 
Transaction 0x19 Complus 0x11 
Commonlog 0x1a Aaf 0x12 
Video 0x1b Urt 0x13 
Filter_manager 0x1c Acs 0x14 
Monitor 0x1d Dplay 0x15 
Graphics_kernel 0x1e Umi 0x16 
Driver_framework 0x20 Sxs 0x17 
Fve_error_code 0x21 Windows_ce 0x18 
Fwp_error_code 0x22 Http 0x19 
Ndis_error_code 0x23 Usermode_commonlog 0x1a 
Hypervisor 0x35 Usermode_filter_manager 0x1f 
Ipsec 0x36 Backgroundcopy 0x20 
Maximum_value 0x37 Configuration 0x21 
  State_management 0x22 
  Metadirectory 0x23 
  Windowsupdate 0x24 
  Directoryservice 0x25 
  Graphics 0x26 
  Shell 0x27 
  Tpm_services 0x28 
  Tpm_software 0x29 
  Pla 0x30 
  Fve 0x31 
  Fwp 0x32 
  Winrm 0x33 
  Ndis 0x34 
  Usermode_hypervisor 0x35 
  Cmi 0x36 
  Windows_defender 0x50 
-2147220978样式数字是32位有符号整数,使用计算器转换为十六进制

WinError.h中定义了Windows错误(小数值)和COM HRESULT(通常,但有例外,以8开头,如0x80040154中所示),但8007nnnn除外,在8007nnnn中可以查找其中包含的窗口错误号

一般来说,窗口错误小于65535(0xFFFF)。启动0x80000001的错误是组件对象模型(COM)HRESULT。启动0xc0000001的错误是NTStatus结果

NTStatus错误(通常但不总是以C开头,如0xC0000022)在NTStatus.h中定义

.h文件是最好的来源,因为它包含错误的符号名,可以提供错误来源等线索。FormatMessage不提供符号名,只提供描述

您可以通过下载平台SDK(千兆字节)获得这些文件

如果你只是想要这两个文件,我会把它们放在我的skydrive上,这样我可以在任何地方引用它们。

注意:internet错误(12000-12999)是windows错误,但在wininet.h中指定,也可以在上面找到

其他.h文件中定义了错误。但99%的人属于上述三类

HRESULT和NTStatus代码的结构

Code Message 
01 Invalid function number 
02 File not found 
03 Path not found 
04 Too many open files (no handles left) 
05 Access denied 
06 Invalid handle 
07 Memory control blocks destroyed 
08 Insufficient memory 
09 Invalid memory block address 
0A Invalid environment 
0B Invalid format 
0C Invalid access mode (open mode is invalid) 
0D Invalid data 
0E Reserved 
0F Invalid drive specified 
10 Attempt to remove current directory 
11 Not same device 
12 No more files 
13 Attempt to write on a write-protected diskette 
14 Unknown unit 
15 Drive not ready 
16 Unknown command 
17 CRC error 
18 Bad request structure length 
19 Seek error 
1A Unknown media type 
1B Sector not found 
1C Printer out of paper 
1D Write fault 
1E Read fault 
1F General failure 
20 Sharing violation 
21 Lock violation 
22 Invalid disk change 
23 FCB unavailable 
24 Sharing buffer overflow 
25 Reserved 
26 Unable to complete file operation (DOS 4.x) 
27-31 Reserved 
32 Network request not supported 
33 Remote computer not listening 
34 Duplicate name on network 
35 Network name not found 
36 Network busy 
37 Network device no longer exists 
38 NetBIOS command limit exceeded 
39 Network adapter error 
3A Incorrect network response 
3B Unexpected network error 
3C Incompatible remote adapter 
3D Print queue full 
3E No space for print file 
3F Print file deleted 
40 Network name deleted 
41 Access denied 
42 Network device type incorrect 
43 Network name not found 
44 Network name limit exceeded 
45 NetBIOS session limit exceeded 
46 Temporarily paused 
47 Network request not accepted 
48 Print or disk redirection is paused 
49-4F Reserved 
50 File already exists 
51 Reserved 
52 Cannot make directory entry 
53 Fail on INT 24 
54 Too many redirections 
55 Duplicate redirection 
56 Invalid password 
57 Invalid parameter 
58 Network device fault 
59 Function not supported by network (DOS 4.x) 
5A Required system component not installed (DOS 4.x) 
NTStatus Facilities  HResults Facilities  
Common status values 0x0 Null 0x0 
Debugger 0x1 Rpc 0x1 
Rpc_runtime 0x2 Dispatch 0x2 
Rpc_stubs 0x3 Storage 0x3 
Io_error_code 0x4 Itf 0x4 
Various drivers 0x5-0xf Win32 0x7 
Ntwin32 0x7 Windows 0x8 
Ntsspi 0x9 Sspi 0x9 
Terminal_server 0xa Security 0x9 
Faciltiy_mui_error_code 0xb Control 0xa 
Usb_error_code 0x10 Cert 0xb 
Hid_error_code 0x11 Internet 0xc 
Firewire_error_code 0x12 Mediaserver 0xd 
Cluster_error_code 0x13 Msmq 0xe 
Acpi_error_code 0x14 Setupapi 0xf 
Sxs_error_code 0x15 Scard 0x10 
Transaction 0x19 Complus 0x11 
Commonlog 0x1a Aaf 0x12 
Video 0x1b Urt 0x13 
Filter_manager 0x1c Acs 0x14 
Monitor 0x1d Dplay 0x15 
Graphics_kernel 0x1e Umi 0x16 
Driver_framework 0x20 Sxs 0x17 
Fve_error_code 0x21 Windows_ce 0x18 
Fwp_error_code 0x22 Http 0x19 
Ndis_error_code 0x23 Usermode_commonlog 0x1a 
Hypervisor 0x35 Usermode_filter_manager 0x1f 
Ipsec 0x36 Backgroundcopy 0x20 
Maximum_value 0x37 Configuration 0x21 
  State_management 0x22 
  Metadirectory 0x23 
  Windowsupdate 0x24 
  Directoryservice 0x25 
  Graphics 0x26 
  Shell 0x27 
  Tpm_services 0x28 
  Tpm_software 0x29 
  Pla 0x30 
  Fve 0x31 
  Fwp 0x32 
  Winrm 0x33 
  Ndis 0x34 
  Usermode_hypervisor 0x35 
  Cmi 0x36 
  Windows_defender 0x50 
HRESULT中的最高有效位和NTStatus中的两个最高有效位设置为错误。因此,HRESULT在出错时启动8,NTStatus在出错时启动C。接下来的14或15位是保留的,有些位指定了设备-错误所在的区域。这是读取十六进制时的第三个和第四个数字。例如0xnn07nnnn-HResult工具代码7是正常的Windows错误(从COM程序返回-因此它作为HResult返回)。设施代码在Winerror.h中定义为HRESULT,在NTStatus.h中定义为NTStatus代码。他们是不同的

解码0x8003nnn错误

Code Message 
01 Invalid function number 
02 File not found 
03 Path not found 
04 Too many open files (no handles left) 
05 Access denied 
06 Invalid handle 
07 Memory control blocks destroyed 
08 Insufficient memory 
09 Invalid memory block address 
0A Invalid environment 
0B Invalid format 
0C Invalid access mode (open mode is invalid) 
0D Invalid data 
0E Reserved 
0F Invalid drive specified 
10 Attempt to remove current directory 
11 Not same device 
12 No more files 
13 Attempt to write on a write-protected diskette 
14 Unknown unit 
15 Drive not ready 
16 Unknown command 
17 CRC error 
18 Bad request structure length 
19 Seek error 
1A Unknown media type 
1B Sector not found 
1C Printer out of paper 
1D Write fault 
1E Read fault 
1F General failure 
20 Sharing violation 
21 Lock violation 
22 Invalid disk change 
23 FCB unavailable 
24 Sharing buffer overflow 
25 Reserved 
26 Unable to complete file operation (DOS 4.x) 
27-31 Reserved 
32 Network request not supported 
33 Remote computer not listening 
34 Duplicate name on network 
35 Network name not found 
36 Network busy 
37 Network device no longer exists 
38 NetBIOS command limit exceeded 
39 Network adapter error 
3A Incorrect network response 
3B Unexpected network error 
3C Incompatible remote adapter 
3D Print queue full 
3E No space for print file 
3F Print file deleted 
40 Network name deleted 
41 Access denied 
42 Network device type incorrect 
43 Network name not found 
44 Network name limit exceeded 
45 NetBIOS session limit exceeded 
46 Temporarily paused 
47 Network request not accepted 
48 Print or disk redirection is paused 
49-4F Reserved 
50 File already exists 
51 Reserved 
52 Cannot make directory entry 
53 Fail on INT 24 
54 Too many redirections 
55 Duplicate redirection 
56 Invalid password 
57 Invalid parameter 
58 Network device fault 
59 Function not supported by network (DOS 4.x) 
5A Required system component not installed (DOS 4.x) 
NTStatus Facilities  HResults Facilities  
Common status values 0x0 Null 0x0 
Debugger 0x1 Rpc 0x1 
Rpc_runtime 0x2 Dispatch 0x2 
Rpc_stubs 0x3 Storage 0x3 
Io_error_code 0x4 Itf 0x4 
Various drivers 0x5-0xf Win32 0x7 
Ntwin32 0x7 Windows 0x8 
Ntsspi 0x9 Sspi 0x9 
Terminal_server 0xa Security 0x9 
Faciltiy_mui_error_code 0xb Control 0xa 
Usb_error_code 0x10 Cert 0xb 
Hid_error_code 0x11 Internet 0xc 
Firewire_error_code 0x12 Mediaserver 0xd 
Cluster_error_code 0x13 Msmq 0xe 
Acpi_error_code 0x14 Setupapi 0xf 
Sxs_error_code 0x15 Scard 0x10 
Transaction 0x19 Complus 0x11 
Commonlog 0x1a Aaf 0x12 
Video 0x1b Urt 0x13 
Filter_manager 0x1c Acs 0x14 
Monitor 0x1d Dplay 0x15 
Graphics_kernel 0x1e Umi 0x16 
Driver_framework 0x20 Sxs 0x17 
Fve_error_code 0x21 Windows_ce 0x18 
Fwp_error_code 0x22 Http 0x19 
Ndis_error_code 0x23 Usermode_commonlog 0x1a 
Hypervisor 0x35 Usermode_filter_manager 0x1f 
Ipsec 0x36 Backgroundcopy 0x20 
Maximum_value 0x37 Configuration 0x21 
  State_management 0x22 
  Metadirectory 0x23 
  Windowsupdate 0x24 
  Directoryservice 0x25 
  Graphics 0x26 
  Shell 0x27 
  Tpm_services 0x28 
  Tpm_software 0x29 
  Pla 0x30 
  Fve 0x31 
  Fwp 0x32 
  Winrm 0x33 
  Ndis 0x34 
  Usermode_hypervisor 0x35 
  Cmi 0x36 
  Windows_defender 0x50 
设施代码为3的HResult表示HResult包含OLE结构化存储错误(0x0到0xff)。这些与Dos错误代码相同。这些似乎不在Windows的头文件中,代码列表在本文末尾

解码0x8004nnnn错误

Code Message 
01 Invalid function number 
02 File not found 
03 Path not found 
04 Too many open files (no handles left) 
05 Access denied 
06 Invalid handle 
07 Memory control blocks destroyed 
08 Insufficient memory 
09 Invalid memory block address 
0A Invalid environment 
0B Invalid format 
0C Invalid access mode (open mode is invalid) 
0D Invalid data 
0E Reserved 
0F Invalid drive specified 
10 Attempt to remove current directory 
11 Not same device 
12 No more files 
13 Attempt to write on a write-protected diskette 
14 Unknown unit 
15 Drive not ready 
16 Unknown command 
17 CRC error 
18 Bad request structure length 
19 Seek error 
1A Unknown media type 
1B Sector not found 
1C Printer out of paper 
1D Write fault 
1E Read fault 
1F General failure 
20 Sharing violation 
21 Lock violation 
22 Invalid disk change 
23 FCB unavailable 
24 Sharing buffer overflow 
25 Reserved 
26 Unable to complete file operation (DOS 4.x) 
27-31 Reserved 
32 Network request not supported 
33 Remote computer not listening 
34 Duplicate name on network 
35 Network name not found 
36 Network busy 
37 Network device no longer exists 
38 NetBIOS command limit exceeded 
39 Network adapter error 
3A Incorrect network response 
3B Unexpected network error 
3C Incompatible remote adapter 
3D Print queue full 
3E No space for print file 
3F Print file deleted 
40 Network name deleted 
41 Access denied 
42 Network device type incorrect 
43 Network name not found 
44 Network name limit exceeded 
45 NetBIOS session limit exceeded 
46 Temporarily paused 
47 Network request not accepted 
48 Print or disk redirection is paused 
49-4F Reserved 
50 File already exists 
51 Reserved 
52 Cannot make directory entry 
53 Fail on INT 24 
54 Too many redirections 
55 Duplicate redirection 
56 Invalid password 
57 Invalid parameter 
58 Network device fault 
59 Function not supported by network (DOS 4.x) 
5A Required system component not installed (DOS 4.x) 
NTStatus Facilities  HResults Facilities  
Common status values 0x0 Null 0x0 
Debugger 0x1 Rpc 0x1 
Rpc_runtime 0x2 Dispatch 0x2 
Rpc_stubs 0x3 Storage 0x3 
Io_error_code 0x4 Itf 0x4 
Various drivers 0x5-0xf Win32 0x7 
Ntwin32 0x7 Windows 0x8 
Ntsspi 0x9 Sspi 0x9 
Terminal_server 0xa Security 0x9 
Faciltiy_mui_error_code 0xb Control 0xa 
Usb_error_code 0x10 Cert 0xb 
Hid_error_code 0x11 Internet 0xc 
Firewire_error_code 0x12 Mediaserver 0xd 
Cluster_error_code 0x13 Msmq 0xe 
Acpi_error_code 0x14 Setupapi 0xf 
Sxs_error_code 0x15 Scard 0x10 
Transaction 0x19 Complus 0x11 
Commonlog 0x1a Aaf 0x12 
Video 0x1b Urt 0x13 
Filter_manager 0x1c Acs 0x14 
Monitor 0x1d Dplay 0x15 
Graphics_kernel 0x1e Umi 0x16 
Driver_framework 0x20 Sxs 0x17 
Fve_error_code 0x21 Windows_ce 0x18 
Fwp_error_code 0x22 Http 0x19 
Ndis_error_code 0x23 Usermode_commonlog 0x1a 
Hypervisor 0x35 Usermode_filter_manager 0x1f 
Ipsec 0x36 Backgroundcopy 0x20 
Maximum_value 0x37 Configuration 0x21 
  State_management 0x22 
  Metadirectory 0x23 
  Windowsupdate 0x24 
  Directoryservice 0x25 
  Graphics 0x26 
  Shell 0x27 
  Tpm_services 0x28 
  Tpm_software 0x29 
  Pla 0x30 
  Fve 0x31 
  Fwp 0x32 
  Winrm 0x33 
  Ndis 0x34 
  Usermode_hypervisor 0x35 
  Cmi 0x36 
  Windows_defender 0x50 
设施代码为4的HResult表示HResult包含OLE错误(0x0到0x1ff),而范围的其余部分(0x200以后)是特定于组件的错误,因此一个组件的20e与另一个组件的20e具有不同的含义

这就是为什么错误源对于0x80040200以上的错误尤为重要

解码0x8007nnnn错误

Code Message 
01 Invalid function number 
02 File not found 
03 Path not found 
04 Too many open files (no handles left) 
05 Access denied 
06 Invalid handle 
07 Memory control blocks destroyed 
08 Insufficient memory 
09 Invalid memory block address 
0A Invalid environment 
0B Invalid format 
0C Invalid access mode (open mode is invalid) 
0D Invalid data 
0E Reserved 
0F Invalid drive specified 
10 Attempt to remove current directory 
11 Not same device 
12 No more files 
13 Attempt to write on a write-protected diskette 
14 Unknown unit 
15 Drive not ready 
16 Unknown command 
17 CRC error 
18 Bad request structure length 
19 Seek error 
1A Unknown media type 
1B Sector not found 
1C Printer out of paper 
1D Write fault 
1E Read fault 
1F General failure 
20 Sharing violation 
21 Lock violation 
22 Invalid disk change 
23 FCB unavailable 
24 Sharing buffer overflow 
25 Reserved 
26 Unable to complete file operation (DOS 4.x) 
27-31 Reserved 
32 Network request not supported 
33 Remote computer not listening 
34 Duplicate name on network 
35 Network name not found 
36 Network busy 
37 Network device no longer exists 
38 NetBIOS command limit exceeded 
39 Network adapter error 
3A Incorrect network response 
3B Unexpected network error 
3C Incompatible remote adapter 
3D Print queue full 
3E No space for print file 
3F Print file deleted 
40 Network name deleted 
41 Access denied 
42 Network device type incorrect 
43 Network name not found 
44 Network name limit exceeded 
45 NetBIOS session limit exceeded 
46 Temporarily paused 
47 Network request not accepted 
48 Print or disk redirection is paused 
49-4F Reserved 
50 File already exists 
51 Reserved 
52 Cannot make directory entry 
53 Fail on INT 24 
54 Too many redirections 
55 Duplicate redirection 
56 Invalid password 
57 Invalid parameter 
58 Network device fault 
59 Function not supported by network (DOS 4.x) 
5A Required system component not installed (DOS 4.x) 
NTStatus Facilities  HResults Facilities  
Common status values 0x0 Null 0x0 
Debugger 0x1 Rpc 0x1 
Rpc_runtime 0x2 Dispatch 0x2 
Rpc_stubs 0x3 Storage 0x3 
Io_error_code 0x4 Itf 0x4 
Various drivers 0x5-0xf Win32 0x7 
Ntwin32 0x7 Windows 0x8 
Ntsspi 0x9 Sspi 0x9 
Terminal_server 0xa Security 0x9 
Faciltiy_mui_error_code 0xb Control 0xa 
Usb_error_code 0x10 Cert 0xb 
Hid_error_code 0x11 Internet 0xc 
Firewire_error_code 0x12 Mediaserver 0xd 
Cluster_error_code 0x13 Msmq 0xe 
Acpi_error_code 0x14 Setupapi 0xf 
Sxs_error_code 0x15 Scard 0x10 
Transaction 0x19 Complus 0x11 
Commonlog 0x1a Aaf 0x12 
Video 0x1b Urt 0x13 
Filter_manager 0x1c Acs 0x14 
Monitor 0x1d Dplay 0x15 
Graphics_kernel 0x1e Umi 0x16 
Driver_framework 0x20 Sxs 0x17 
Fve_error_code 0x21 Windows_ce 0x18 
Fwp_error_code 0x22 Http 0x19 
Ndis_error_code 0x23 Usermode_commonlog 0x1a 
Hypervisor 0x35 Usermode_filter_manager 0x1f 
Ipsec 0x36 Backgroundcopy 0x20 
Maximum_value 0x37 Configuration 0x21 
  State_management 0x22 
  Metadirectory 0x23 
  Windowsupdate 0x24 
  Directoryservice 0x25 
  Graphics 0x26 
  Shell 0x27 
  Tpm_services 0x28 
  Tpm_software 0x29 
  Pla 0x30 
  Fve 0x31 
  Fwp 0x32 
  Winrm 0x33 
  Ndis 0x34 
  Usermode_hypervisor 0x35 
  Cmi 0x36 
  Windows_defender 0x50 
设施代码为7的HResult表示HResult包含Windows的错误代码。您必须查找Windows的错误代码,而不是HResult

要解码0x80070002。0x表示它是一个十六进制数,8表示错误,前7表示它是一个windows错误,其余数字2表示实际的windows错误

要查找错误,我们需要十进制格式。启动计算器(开始-所有程序-附件-计算器)并选择查看菜单-科学,然后选择查看菜单-十六进制。输入2。然后查看菜单-十进制。它会说2

启动命令提示符(启动-所有程序-附件-命令提示符)并键入

它会说

The system cannot find the file specified.
或者在winerror.h中查找

//
// MessageId: ERROR_FILE_NOT_FOUND
//
// MessageText:
//
// The system cannot find the file specified.
//
#define ERROR_FILE_NOT_FOUND             2L
解码0x8019nnnn错误

Code Message 
01 Invalid function number 
02 File not found 
03 Path not found 
04 Too many open files (no handles left) 
05 Access denied 
06 Invalid handle 
07 Memory control blocks destroyed 
08 Insufficient memory 
09 Invalid memory block address 
0A Invalid environment 
0B Invalid format 
0C Invalid access mode (open mode is invalid) 
0D Invalid data 
0E Reserved 
0F Invalid drive specified 
10 Attempt to remove current directory 
11 Not same device 
12 No more files 
13 Attempt to write on a write-protected diskette 
14 Unknown unit 
15 Drive not ready 
16 Unknown command 
17 CRC error 
18 Bad request structure length 
19 Seek error 
1A Unknown media type 
1B Sector not found 
1C Printer out of paper 
1D Write fault 
1E Read fault 
1F General failure 
20 Sharing violation 
21 Lock violation 
22 Invalid disk change 
23 FCB unavailable 
24 Sharing buffer overflow 
25 Reserved 
26 Unable to complete file operation (DOS 4.x) 
27-31 Reserved 
32 Network request not supported 
33 Remote computer not listening 
34 Duplicate name on network 
35 Network name not found 
36 Network busy 
37 Network device no longer exists 
38 NetBIOS command limit exceeded 
39 Network adapter error 
3A Incorrect network response 
3B Unexpected network error 
3C Incompatible remote adapter 
3D Print queue full 
3E No space for print file 
3F Print file deleted 
40 Network name deleted 
41 Access denied 
42 Network device type incorrect 
43 Network name not found 
44 Network name limit exceeded 
45 NetBIOS session limit exceeded 
46 Temporarily paused 
47 Network request not accepted 
48 Print or disk redirection is paused 
49-4F Reserved 
50 File already exists 
51 Reserved 
52 Cannot make directory entry 
53 Fail on INT 24 
54 Too many redirections 
55 Duplicate redirection 
56 Invalid password 
57 Invalid parameter 
58 Network device fault 
59 Function not supported by network (DOS 4.x) 
5A Required system component not installed (DOS 4.x) 
NTStatus Facilities  HResults Facilities  
Common status values 0x0 Null 0x0 
Debugger 0x1 Rpc 0x1 
Rpc_runtime 0x2 Dispatch 0x2 
Rpc_stubs 0x3 Storage 0x3 
Io_error_code 0x4 Itf 0x4 
Various drivers 0x5-0xf Win32 0x7 
Ntwin32 0x7 Windows 0x8 
Ntsspi 0x9 Sspi 0x9 
Terminal_server 0xa Security 0x9 
Faciltiy_mui_error_code 0xb Control 0xa 
Usb_error_code 0x10 Cert 0xb 
Hid_error_code 0x11 Internet 0xc 
Firewire_error_code 0x12 Mediaserver 0xd 
Cluster_error_code 0x13 Msmq 0xe 
Acpi_error_code 0x14 Setupapi 0xf 
Sxs_error_code 0x15 Scard 0x10 
Transaction 0x19 Complus 0x11 
Commonlog 0x1a Aaf 0x12 
Video 0x1b Urt 0x13 
Filter_manager 0x1c Acs 0x14 
Monitor 0x1d Dplay 0x15 
Graphics_kernel 0x1e Umi 0x16 
Driver_framework 0x20 Sxs 0x17 
Fve_error_code 0x21 Windows_ce 0x18 
Fwp_error_code 0x22 Http 0x19 
Ndis_error_code 0x23 Usermode_commonlog 0x1a 
Hypervisor 0x35 Usermode_filter_manager 0x1f 
Ipsec 0x36 Backgroundcopy 0x20 
Maximum_value 0x37 Configuration 0x21 
  State_management 0x22 
  Metadirectory 0x23 
  Windowsupdate 0x24 
  Directoryservice 0x25 
  Graphics 0x26 
  Shell 0x27 
  Tpm_services 0x28 
  Tpm_software 0x29 
  Pla 0x30 
  Fve 0x31 
  Fwp 0x32 
  Winrm 0x33 
  Ndis 0x34 
  Usermode_hypervisor 0x35 
  Cmi 0x36 
  Windows_defender 0x50 
设施为0x19的HRESULT是HTTP错误。16384(0x4000)下的代码与HTTP错误相同,例如HTTP状态404:服务器上不存在请求的URL是0x80190194(0x194=404)。代码16384和更高是特定于位的

Dos错误代码(针对0x8003nnn错误)

设施代码

Code Message 
01 Invalid function number 
02 File not found 
03 Path not found 
04 Too many open files (no handles left) 
05 Access denied 
06 Invalid handle 
07 Memory control blocks destroyed 
08 Insufficient memory 
09 Invalid memory block address 
0A Invalid environment 
0B Invalid format 
0C Invalid access mode (open mode is invalid) 
0D Invalid data 
0E Reserved 
0F Invalid drive specified 
10 Attempt to remove current directory 
11 Not same device 
12 No more files 
13 Attempt to write on a write-protected diskette 
14 Unknown unit 
15 Drive not ready 
16 Unknown command 
17 CRC error 
18 Bad request structure length 
19 Seek error 
1A Unknown media type 
1B Sector not found 
1C Printer out of paper 
1D Write fault 
1E Read fault 
1F General failure 
20 Sharing violation 
21 Lock violation 
22 Invalid disk change 
23 FCB unavailable 
24 Sharing buffer overflow 
25 Reserved 
26 Unable to complete file operation (DOS 4.x) 
27-31 Reserved 
32 Network request not supported 
33 Remote computer not listening 
34 Duplicate name on network 
35 Network name not found 
36 Network busy 
37 Network device no longer exists 
38 NetBIOS command limit exceeded 
39 Network adapter error 
3A Incorrect network response 
3B Unexpected network error 
3C Incompatible remote adapter 
3D Print queue full 
3E No space for print file 
3F Print file deleted 
40 Network name deleted 
41 Access denied 
42 Network device type incorrect 
43 Network name not found 
44 Network name limit exceeded 
45 NetBIOS session limit exceeded 
46 Temporarily paused 
47 Network request not accepted 
48 Print or disk redirection is paused 
49-4F Reserved 
50 File already exists 
51 Reserved 
52 Cannot make directory entry 
53 Fail on INT 24 
54 Too many redirections 
55 Duplicate redirection 
56 Invalid password 
57 Invalid parameter 
58 Network device fault 
59 Function not supported by network (DOS 4.x) 
5A Required system component not installed (DOS 4.x) 
NTStatus Facilities  HResults Facilities  
Common status values 0x0 Null 0x0 
Debugger 0x1 Rpc 0x1 
Rpc_runtime 0x2 Dispatch 0x2 
Rpc_stubs 0x3 Storage 0x3 
Io_error_code 0x4 Itf 0x4 
Various drivers 0x5-0xf Win32 0x7 
Ntwin32 0x7 Windows 0x8 
Ntsspi 0x9 Sspi 0x9 
Terminal_server 0xa Security 0x9 
Faciltiy_mui_error_code 0xb Control 0xa 
Usb_error_code 0x10 Cert 0xb 
Hid_error_code 0x11 Internet 0xc 
Firewire_error_code 0x12 Mediaserver 0xd 
Cluster_error_code 0x13 Msmq 0xe 
Acpi_error_code 0x14 Setupapi 0xf 
Sxs_error_code 0x15 Scard 0x10 
Transaction 0x19 Complus 0x11 
Commonlog 0x1a Aaf 0x12 
Video 0x1b Urt 0x13 
Filter_manager 0x1c Acs 0x14 
Monitor 0x1d Dplay 0x15 
Graphics_kernel 0x1e Umi 0x16 
Driver_framework 0x20 Sxs 0x17 
Fve_error_code 0x21 Windows_ce 0x18 
Fwp_error_code 0x22 Http 0x19 
Ndis_error_code 0x23 Usermode_commonlog 0x1a 
Hypervisor 0x35 Usermode_filter_manager 0x1f 
Ipsec 0x36 Backgroundcopy 0x20 
Maximum_value 0x37 Configuration 0x21 
  State_management 0x22 
  Metadirectory 0x23 
  Windowsupdate 0x24 
  Directoryservice 0x25 
  Graphics 0x26 
  Shell 0x27 
  Tpm_services 0x28 
  Tpm_software 0x29 
  Pla 0x30 
  Fve 0x31 
  Fwp 0x32 
  Winrm 0x33 
  Ndis 0x34 
  Usermode_hypervisor 0x35 
  Cmi 0x36 
  Windows_defender 0x50 

在查看代码之后,错误处理似乎隐藏了与解析memberof属性有关的真正错误。一旦我修改了错误处理,我就检测到了原始错误并更正了它

谢谢大家的帮助
干杯

您好,谢谢您的回复。在这里发布之前,我还发现了错误代码:,这就是我要求获得其他经验的原因,因为我非常确定代码是正确的。在任何情况下,信息的thx