Compartir a través de


Openfiles

Queries or displays open files. Also queries, displays, or disconnects files opened by network users.

To view the command syntax, click a command:

openfiles disconnect

Disconnects one or more remote users connected to open shared files.

Syntax

openfiles.exe /disconnect [/s Computer [/u Domain\User [/p Password]]] {[/id OpenFileID]|[/a UserName]|[/o OpenMode]} [/se SessionName] [/op OpenFileName]

Parameters

/s   Computer   : Specifies the name or IP address of a remote computer. (Do not use backslashes.) The default is the local computer.

/u   Domain \ User   : Runs the command with the account permissions of the user specified by User or Domain\User. The default is the permissions of the current logged on user on the computer issuing the command.

/p   Password   : Specifies the password of the user account that is specified in the /u parameter.

/id   OpenFileID   : Disconnects the file opened with the specified numeric OpenFileID on the computer specified by the /s parameter. Use openfiles.exe /query to learn the file ID. The wildcard (*) can be used to disconnect all open files on the specified computer.

/a   UserName   : Disconnects all open files that were accessed by the specified user on the computer specified by the /s parameter. The wildcard (*) can be used to disconnect all open files on the specified computer.

/o   OpenMode   : Disconnects all open files with the specified OpenMode on the computer specified by the /s parameter. The OpenMode parameter includes the Read/Write and Read modes. The wildcard (*) can be used to disconnect all open files on the specified computer.

/se   SessionName   : Disconnects all open files that were created by the specified session on the computer specified by the /s parameter. The wildcard (*) can be used to disconnect all open files on the specified computer.

/op   OpenFileName   : Disconnects the open file that was created with the specified OpenFileName on the computer specified by the /s parameter. The wildcard (*) can be used to disconnect all open files on the specified computer.

/? : Displays help at the command prompt.

Examples

The following examples show how you can use the openfiles /disconnect command:

openfiles.exe /disconnect /id 1
openfiles.exe /disconnect /a hiropln
openfiles.exe /disconnect /o read/write
openfiles.exe /disconnect /op "c:\my documents\somedoc.doc"
openfiles /disconnect /session machine /id 5
openfiles.exe /disconnect /s srvmain /u maindom\hiropln /id 5
openfiles /disconnect /s srvmain /u maindom\hiropln /p p@ssW23 /id *

openfiles query

Queries and displays all open files.

Syntax

openfiles.exe /query [/s Computer [/u Domain\User [/p Password]]] [/fo {TABLE|LIST|CSV}] [/nh] [/v]

Parameters

/s   Computer   : Specifies the name or IP address of a remote computer. (Do not use backslashes.) The default is the local computer.

/u   Domain \ User   : Runs the command with the account permissions of the user specified by User or Domain\User. The default is the permissions of the current logged on user on the computer issuing the command.

/p   Password   : Specifies the password of the user account that is specified in the /u parameter.

/fo { TABLE | LIST | CSV } : Specifies the format to use for the query output. Valid values are TABLE, LIST, and CSV. The default value for output is TABLE.

/nh   : Suppresses column header in the output. Valid only when the /fo parameter is set to TABLE or CSV.

/v   : Specifies that verbose task information be displayed in the output.

/? : Displays help at the command prompt.

Examples

The following examples show how you can use the openfiles /query command:

openfiles.exe /query
openfiles.exe /query /fo table /nh
openfiles.exe /query /fo list /v
openfiles.exe /query /s srvmain /u maindom\hiropln /p p@ssW23

Formatting legend

Format

Meaning

Italic

Information that the user must supply

Bold

Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output

Command-line reference A-Z