2.2.2.1 SMB_COM Command Codes

Following is a listing of all SMB commands used in CIFS and their associated command codes, as well as additional useful information. The table reads as follows:

NT LAN Manager name and pre-NT LAN Manager name: Current name of command and alternate name used in older documentation, if available. If a code or code range is marked Unused, it is undefined and reserved for future use. If a code or code range is marked Reserved, it is or was reserved for a specific purpose. Both of these indicate that client implementations SHOULD NOT send messages using any of those command codes.

Code: An SMB command code.

Description: A short description of the command. If a code or code range is marked as Reserved, this field lists its intended use.

Status: Current status of the command's usage (Deprecated, Obsolescent, or Obsolete) as used in this context.

  • C = Currently used

  • D = Deprecated

  • O = Obsolescent

  • X = Obsolete

  • N = Not implemented - The command code was reserved and in some cases documented, but the command was never implemented.

Earliest dialect: Earliest known dialect in which this command appears.

NT LAN Manager name and pre-NT LAN Manager name

Code

Description

Status

Earliest dialect

SMB_COM_CREATE_DIRECTORY (section 2.2.4.1)

SMBmkdir

0x00

Create a new directory.

D

CORE

SMB_COM_DELETE_DIRECTORY (section 2.2.4.2)

SMBrmdir

0x01

Delete an empty directory.

C

CORE

SMB_COM_OPEN (section 2.2.4.3)

SMBopen

0x02

Open a file.

D

CORE

SMB_COM_CREATE (section 2.2.4.4)

SMBcreate

0x03

Create or open a file.

D

CORE

SMB_COM_CLOSE (section 2.2.4.5)

SMBclose

0x04

Close a file.

C

CORE

SMB_COM_FLUSH (section 2.2.4.6)

SMBflush

0x05

Flush data for a file, or all files associated with a client, PID pair.

C

CORE

SMB_COM_DELETE (section 2.2.4.7)

SMBunlink

0x06

Delete a file.

C

CORE

SMB_COM_RENAME (section 2.2.4.8)

SMBmv

0x07

Rename a file or set of files.

C

CORE

SMB_COM_QUERY_INFORMATION (section 2.2.4.9)

SMBgetattr

0x08

Get file attributes.

D

CORE

SMB_COM_SET_INFORMATION (section 2.2.4.10)

SMBsetattr

0x09

Set file attributes.

D

CORE

SMB_COM_READ (section 2.2.4.11)

SMBread

0x0A

Read from a file.

D

CORE

SMB_COM_WRITE (section 2.2.4.12)

SMBwrite

0x0B

Write to a file.

D

CORE

SMB_COM_LOCK_BYTE_RANGE (section 2.2.4.13)

SMBlock

0x0C

Request a byte-range lock on a file.

D

CORE

SMB_COM_UNLOCK_BYTE_RANGE (section 2.2.4.14)

SMBunlock

0x0D

Release a byte-range lock on a file.

D

CORE

SMB_COM_CREATE_TEMPORARY (section 2.2.4.15)

SMBctemp

0x0E

Create a temporary file.

O

CORE

SMB_COM_CREATE_NEW (section 2.2.4.16)

SMBmknew

0x0F

Create and open a new file.

D

CORE

SMB_COM_CHECK_DIRECTORY (section 2.2.4.17)

SMBchkpth

0x10

Verify that the specified pathname resolves to a directory.

Listed as SMBchkpath in some documentation.

C

CORE

SMB_COM_PROCESS_EXIT (section 2.2.4.18)

SMBexit

0x11

Indicate process exit.

O

CORE

SMB_COM_SEEK (section 2.2.4.19)

SMBlseek

0x12

Set the current file pointer within a file.

O

CORE

SMB_COM_LOCK_AND_READ (section 2.2.4.20)

SMBlockread

0x13

Lock and read a byte-range within a file.

D

CorePlus

SMB_COM_WRITE_AND_UNLOCK (section 2.2.4.21)

SMBwriteunlock

0x14

Write and unlock a byte-range within a file.

D

CorePlus

Unused

0x15

...

0x19

SMB_COM_READ_RAW (section 2.2.4.22)

SMBreadBraw

0x1A

Read a block in raw mode.

D

CorePlus

SMB_COM_READ_MPX (section 2.2.4.23)

SMBreadBmpx

0x1B

Multiplexed block read.

Listed as SMBreadmpx in some documentation.

O

LANMAN1.0

SMB_COM_READ_MPX_SECONDARY (section 2.2.4.24)

SMBreadBs

0x1C

Multiplexed block read, secondary request.

X

LANMAN1.0

SMB_COM_WRITE_RAW (section 2.2.4.25)

SMBwriteBraw

0x1D

Write a block in raw mode.

D

CorePlus

SMB_COM_WRITE_MPX (section 2.2.4.26)

SMBwriteBmpx

0x1E

Multiplexed block write.

O

LANMAN1.0

SMB_COM_WRITE_MPX_SECONDARY (section 2.2.4.27)

SMBwriteBs

0x1F

Multiplexed block write, secondary request.

X

LANMAN1.0

SMB_COM_WRITE_COMPLETE (section 2.2.4.28)

SMBwriteC

0x20

Raw block write, final response.

D

LANMAN1.0

SMB_COM_QUERY_SERVER (section 2.2.4.29)

0x21

Reserved, but not implemented.

Also known as SMB_COM_QUERY_INFORMATION_SRV.

N

SMB_COM_SET_INFORMATION2 (section 2.2.4.30)

SMBsetattrE

0x22

Set an extended set of file attributes.

D

LANMAN1.0

SMB_COM_QUERY_INFORMATION2 (section 2.2.4.31)

SMBgetattrE

0x23

Get an extended set of file attributes.

D

LANMAN1.0

SMB_COM_LOCKING_ANDX (section 2.2.4.32)

SMBlockingX

0x24

Lock multiple byte ranges; AndX chaining.

C

LANMAN1.0

SMB_COM_TRANSACTION (section 2.2.4.33)

SMBtrans

0x25

Transaction.

C

LANMAN1.0

SMB_COM_TRANSACTION_SECONDARY (section 2.2.4.34)

SMBtranss

0x26

Transaction secondary request.

C

LANMAN1.0

SMB_COM_IOCTL (section 2.2.4.35)

SMBioctl

0x27

Pass an I/O Control function request to the server.

O

LANMAN1.0

SMB_COM_IOCTL_SECONDARY (section 2.2.4.36)

SMBioctls

0x28

IOCTL secondary request.

N

LANMAN1.0

SMB_COM_COPY (section 2.2.4.37)

SMBcopy

0x29

Copy a file or directory.

X

LANMAN1.0

SMB_COM_MOVE (section 2.2.4.38)

SMBmove

0x2A

Move a file or directory.

X

LANMAN1.0

SMB_COM_ECHO (section 2.2.4.39)

SMBecho

0x2B

Echo request (ping).

C

LANMAN1.0

SMB_COM_WRITE_AND_CLOSE (section 2.2.4.40)

SMBwriteclose

0x2C

Write to and close a file.

D

LANMAN1.0

SMB_COM_OPEN_ANDX (section 2.2.4.41)

SMBopenX

0x2D

Extended file open with AndX chaining.

D

LANMAN1.0

SMB_COM_READ_ANDX (section 2.2.4.42)

SMBreadX

0x2E

Extended file read with AndX chaining.

C

LANMAN1.0

SMB_COM_WRITE_ANDX (section 2.2.4.43)

SMBwriteX

0x2F

Extended file write with AndX chaining.

C

LANMAN1.0

SMB_COM_NEW_FILE_SIZE (section 2.2.4.44)

0x30

Reserved, but not implemented.

Also known as SMB_COM_SET_NEW_SIZE.

N

SMB_COM_CLOSE_AND_TREE_DISC (section 2.2.4.45)

0x31

Close an open file and tree disconnect.

N

NT LANMAN

SMB_COM_TRANSACTION2 (section 2.2.4.46)

SMBtrans2

0x32

Transaction 2 format request/response.

C

LANMAN1.2

SMB_COM_TRANSACTION2_SECONDARY (section 2.2.4.47)

SMBtranss2

0x33

Transaction 2 secondary request.

C

LANMAN1.2

SMB_COM_FIND_CLOSE2 (section 2.2.4.48)

SMBfindclose

0x34

Close an active search.

C

LANMAN1.2

SMB_COM_FIND_NOTIFY_CLOSE (section 2.2.4.49)

SMBfindnclose

0x35

Notification of the closure of an active search.

N

LANMAN1.2

Unused

0x36

...

0x5F

Reserved

0x60

...

0x6F

This range of codes was reserved for use by the "xenix1.1" dialect of SMB. See [MSFT-XEXTNP]. [XOPEN-SMB] page 41 lists this range as "Reserved for proprietary dialects."

X

XENIX

SMB_COM_TREE_CONNECT (section 2.2.4.50)

SMBtcon

0x70

Tree connect.

D

CORE

SMB_COM_TREE_DISCONNECT (section 2.2.4.51)

SMBtdis

0x71

Tree disconnect.

C

CORE

SMB_COM_NEGOTIATE (section 2.2.4.52)

SMBnegprot

0x72

Negotiate protocol dialect.

C

CORE

SMB_COM_SESSION_SETUP_ANDX (section 2.2.4.53)

SMBsesssetupX

0x73

Session Setup with AndX chaining.

C

LANMAN1.0

SMB_COM_LOGOFF_ANDX (section 2.2.4.54)

SMBulogoffX

0x74

User logoff with AndX chaining.

C

LANMAN1.2

SMB_COM_TREE_CONNECT_ANDX (section 2.2.4.55)

SMBtconX

0x75

Tree connect with AndX chaining.

C

LANMAN1.0

Unused

0x76

...

0x7D

SMB_COM_SECURITY_PACKAGE_ANDX (section 2.2.4.56)

SMBsecpkgX

0x7E

Negotiate security packages with AndX chaining.

X

LANMAN1.0

Unused

0x7F

SMB_COM_QUERY_INFORMATION_DISK (section 2.2.4.57)

SMBdskattr

0x80

Retrieve file system information from the server.

D

CORE

SMB_COM_SEARCH (section 2.2.4.58)

SMBsearch

0x81

Directory wildcard search.

D

CORE

SMB_COM_FIND (section 2.2.4.59)

SMBffirst

0x82

Start or continue an extended wildcard directory search.

D

LANMAN1.0

SMB_COM_FIND_UNIQUE (section 2.2.4.60)

SMBfunique

0x83

Perform a one-time extended wildcard directory search.

D

LANMAN1.0

SMB_COM_FIND_CLOSE (section 2.2.4.61)

SMBfclose

0x84

End an extended wildcard directory search.

D

LANMAN1.0

Unused

0x85

...

0x9F

SMB_COM_NT_TRANSACT (section 2.2.4.62)

0xA0

NT format transaction request/response.

C

NT LANMAN

SMB_COM_NT_TRANSACT_SECONDARY (section 2.2.4.63)

0xA1

NT format transaction secondary request.

C

NT LANMAN

SMB_COM_NT_CREATE_ANDX (section 2.2.4.64)

0xA2

Create or open a file or a directory.

C

NT LANMAN

Unused

0xA3

SMB_COM_NT_CANCEL (section 2.2.4.65)

0xA4

Cancel a request currently pending at the server.

C

NT LANMAN

SMB_COM_NT_RENAME (section 2.2.4.66)

0xA5

File rename with extended semantics.

O

NT LANMAN

Unused

0xA6

...

0xBF

SMB_COM_OPEN_PRINT_FILE (section 2.2.4.67)

SMBsplopen

0xC0

Create a print queue spool file.

C

CORE

SMB_COM_WRITE_PRINT_FILE (section 2.2.4.68)

SMBsplwr

0xC1

Write to a print queue spool file.

D

CORE

SMB_COM_CLOSE_PRINT_FILE (section 2.2.4.69)

SMBsplclose

0xC2

Close a print queue spool file.

D

CORE

SMB_COM_GET_PRINT_QUEUE (section 2.2.4.70)

SMBsplretq

0xC3

Request print queue information.

X

CORE

Unused

0xC4

...

0xCF

Reserved

0xD0

...

0xD7

Messenger Service command codes.

This range is reserved for use by the SMB Messenger Service. See [MS-MSRP], and section 6 of [SMB-CORE].

O

CORE

SMB_COM_READ_BULK (section 2.2.4.71)

0xD8

Reserved, but not implemented.

N

SMB_COM_WRITE_BULK (section 2.2.4.72)

0xD9

Reserved, but not implemented.

N

SMB_COM_WRITE_BULK_DATA (section 2.2.4.73)

0xDA

Reserved, but not implemented.

N

Unused

0xDB

...

0xFD

SMB_COM_INVALID (section 2.2.4.74)

SMBinvalid

0xFE

As the name suggests, this command code is a designated invalid command and SHOULD NOT be used.

C

LANMAN1.0

SMB_COM_NO_ANDX_COMMAND (section 2.2.4.75)

0xFF

Also known as the "NIL" command. It identifies the end of an AndX Chain, and is only valid in that context. See section 2.2.3.4.

C

LANMAN1.0

Show: