You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
224 lines
13 KiB
224 lines
13 KiB
#include "resource.h"
|
|
#include "windows.h"
|
|
#include "cmdlineres.h"
|
|
|
|
#include "cmdline.rc"
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// String Table
|
|
//
|
|
|
|
STRINGTABLE DISCARDABLE
|
|
BEGIN
|
|
IDS_FAILURE "FAILURE: "
|
|
IDS_ERROR_DISCONNECT "ERROR: Could not disconnect the open file ""%s"".\n"
|
|
IDS_INVALID_SYNTAX "Invalid syntax.\nType ""%s /?"" for usage.\n"
|
|
IDS_AUTHENTICATION_FAILURE "ERROR: Could not connect to remote server.\n"
|
|
IDS_INVALID_SERVER_NAME "Invalid server name.\n"
|
|
IDS_HEADER_NOT_ALLOWED "ERROR: Invalid Syntax. /NH option is only allowed for TABLE and CSV formats.\n"
|
|
IDS_ERROR_USERNAME_BUT_NOMACHINE "ERROR: Invalid Syntax. /U option can be specified only when /S option is specified.\n"
|
|
IDS_ERROR_PASSWORD_BUT_NOUSERNAME "ERROR: Invalid Syntax. /P option can be specified only when /U option is specified.\n"
|
|
IDS_NO_ID_ACC_OF "ERROR: Invalid Syntax. No /ID or /A or /O parameter present.\n"
|
|
IDS_ERROR_ID "ERROR: Invalid ID.\n"
|
|
IDS_ID_SHOW_ERROR "ERROR: "
|
|
IDS_INTERNAL_FAILURE "ERROR: Unable to retrieve data.\n"
|
|
IDS_INVALID_CREDENTIALS "ERROR: Could not connect to the specified system with the given credentials.\n"
|
|
IDS_SERVER_EMPTY "ERROR: Invalid syntax. System name cannot be empty.\n"
|
|
IDS_USERNAME_EMPTY "ERROR: Invalid syntax. User name cannot be empty.\n"
|
|
IDS_INVALID_OS "ERROR: The target system must be running Windows XP or above.\n"
|
|
IDS_ACCESSBY_EMPTY "ERROR: Invalid syntax. Accessed by cannot be empty.\n"
|
|
IDS_OPEN_FILE_EMPTY "ERROR: Invalid syntax. File name cannot be empty.\n"
|
|
IDS_ERROR_SYSTEM_INFO "ERROR: Unable to get system type information.\n"
|
|
IDS_ERROR_VERSION_MISMATCH "ERROR: The target system must be running a 32 bit OS.\n"
|
|
IDS_REMOTE_NOT_SUPPORTED "ERROR: Remote open files is not supported for 64 bit machines.\n"
|
|
IDS_ERROR_VERSION_MISMATCH1 "ERROR: The target system must be running a 64 bit OS.\n"
|
|
IDS_REMOTE_NOT_SUPPORTED1 "ERROR: Remote open files is not supported for 32 bit machines.\n"
|
|
IDS_USER_NOT_ADMIN "ERROR: Logged-on user does not have administrative privilege.\n"
|
|
IDS_USER_INVALID_ADMIN "ERROR: Invalid username.\n"
|
|
IDS_FILENAME_INVALID "ERROR: Invalid open file name.\n"
|
|
END
|
|
STRINGTABLE DISCARDABLE
|
|
BEGIN
|
|
IDS_SUCCESS "\nSUCCESS: "
|
|
IDS_NO_OPENFILES "\nINFO: No shared open files found.\n"
|
|
IDS_NO_D_OPENFILES "\nINFO: There are no shared open files found with the specified criteria.\n"
|
|
END
|
|
|
|
STRINGTABLE DISCARDABLE
|
|
BEGIN
|
|
IDS_UTILITY_NAME "OPENFILES"
|
|
IDS_OPENMODE_OPTION "read|write|read/write|*"
|
|
IDS_STRING_HOSTNAME "Hostname"
|
|
IDS_STRING_ID "ID"
|
|
IDS_STRING_ACCESSED_BY "Accessed By"
|
|
IDS_STRING_PID "PID"
|
|
IDS_STRING_TYPE "Type"
|
|
IDS_STRING_LOCK "#Locks"
|
|
IDS_STRING_OPEN_MODE "Open Mode"
|
|
IDS_STRING_OPEN_FILE "Open File (Path\\executable)"
|
|
IDS_STRING_WINDOWS "Windows"
|
|
IDS_READ "Read"
|
|
IDS_WRITE "Write"
|
|
IDS_READ_WRITE "Write + Read"
|
|
IDS_FORMAT_OPTIONS "list|csv|table"
|
|
IDS_LIST "LIST"
|
|
IDS_CSV "CSV"
|
|
IDS_READ_SLASH_WRITE "Read/Write"
|
|
IDS_WRITE_SLASH_READ "Write/Read"
|
|
IDS_MAC_OS "Macintosh"
|
|
IDS_LOCAL_OPEN_FILES "\nFiles Opened Locally:\n"
|
|
IDS_LOCAL_OPEN_FILES_SP1 "---------------------\n"
|
|
IDS_SHARED_OPEN_FILES "\n\nFiles opened remotely via local share points:\n"
|
|
IDS_LOCAL_OPEN_FILES_SP2 "---------------------------------------------\n"
|
|
IDS_STRING_PROCESS_ID "ProcessID"
|
|
IDS_STRING_PROCESS_NAME "Process Name"
|
|
IDS_FILE_TYPE "Type"
|
|
IDS_LOCAL_OPTION "on|off"
|
|
IDS_LOCAL_ON "ON"
|
|
IDS_LOCAL_OFF "OFF"
|
|
END
|
|
STRINGTABLE DISCARDABLE
|
|
BEGIN
|
|
IDS_ID_SHOW_WARNING "WARNING: "
|
|
IDS_LOCAL_SYSTEM "WARNING: Ignoring the user credentials for the local connection.\n"
|
|
IDS_LOCAL_NEEDS_TO_SET1 "\nINFO: The system global flag 'maintain objects list' needs\n"
|
|
IDS_LOCAL_NEEDS_TO_SET2 " to be enabled to see local opened files.\n"
|
|
IDS_LOCAL_NEEDS_TO_SET3 " See Openfiles /? for more information.\n"
|
|
IDS_LOCAL_FLG_SET "\nSUCCESS: The system global flag 'maintain objects list' is enabled.\n This will take effect after the system is restarted.\n"
|
|
IDS_LOCAL_FLG_RESET "\nSUCCESS: The system global flag 'maintain objects list' is disabled..\n This will take effect after the system is restarted.\n"
|
|
IDS_LOCAL_FLG_ALREADY_SET "\nINFO: The system global flag 'maintain objects list' is currently enabled.\n"
|
|
IDS_LOCAL_FLG_ALREADY_RESET "\nINFO: The system global flag 'maintain objects list' is currently disabled.\n"
|
|
END
|
|
STRINGTABLE DISCARDABLE
|
|
BEGIN
|
|
IDS_HELP_LINE1 "\nOPENFILES /Disconnect [/S system [/U username [/P [password]]]]\n"
|
|
IDS_HELP_LINE2 " {[/ID id] [/A accessedby] [/O openmode]}\n"
|
|
IDS_HELP_LINE3 " [/OP openfile]\n\n"
|
|
IDS_HELP_LINE5 "Description:\n"
|
|
IDS_HELP_LINE6 " Enables an administrator to disconnect files and folders that\n"
|
|
IDS_HELP_LINE7 " have been opened remotely through a shared folder.\n\n"
|
|
IDS_HELP_LINE8 "Parameter List:\n"
|
|
IDS_HELP_LINE9 " /S system Specifies the remote system to connect to.\n\n"
|
|
IDS_HELP_LINE10 " /U [domain\]user Specifies the user context under which the\n"
|
|
IDS_HELP_LINE11 " command should execute.\n\n"
|
|
IDS_HELP_LINE12 " /P [password] Specifies the password for the given user\n"
|
|
IDS_HELP_LINE13 " context.\n\n"
|
|
IDS_HELP_LINE14 " /ID id Specifies to disconnect open files by file ID.\n"
|
|
IDS_HELP_LINE15 " The ""*"" wildcard may be used.\n\n"
|
|
IDS_HELP_LINE16 " /A accessedby Specifies to disconnect all open files by\n"
|
|
IDS_HELP_LINE17 " ""accessedby"" value. The ""*"" wildcard\n"
|
|
IDS_HELP_LINE18 " may be used.\n\n"
|
|
IDS_HELP_LINE19 " /O openmode Specifies to disconnect all open files by\n"
|
|
IDS_HELP_LINE20 " ""openmode"" value. Valid values are Read,\n"
|
|
IDS_HELP_LINE21 " Write or Read/Write. The ""*"" wildcard\n"
|
|
IDS_HELP_LINE22 " may be used.\n\n"
|
|
IDS_HELP_LINE23 ""
|
|
IDS_HELP_LINE24 ""
|
|
IDS_HELP_LINE25 ""
|
|
IDS_HELP_LINE26 " /OP openfile Specifies to disconnect all open file\n"
|
|
IDS_HELP_LINE27 " connections created by a specific ""open\n"
|
|
IDS_HELP_LINE28 " file"" name. The ""*"" wildcard may be used.\n\n"
|
|
IDS_HELP_LINE29 " /? Displays this help message.\n\n"
|
|
IDS_HELP_LINE30 "Examples:\n"
|
|
IDS_HELP_LINE31 " OPENFILES /Disconnect /?\n"
|
|
IDS_HELP_LINE32 " OPENFILES /Disconnect /ID 1\n"
|
|
IDS_HELP_LINE33 " OPENFILES /Disconnect /A username\n"
|
|
IDS_HELP_LINE34 " OPENFILES /Disconnect /O Read/Write\n"
|
|
IDS_HELP_LINE35 " OPENFILES /Disconnect /OP ""c:\\My Documents\\somedoc.doc"" /ID 234\n"
|
|
IDS_HELP_LINE36 " OPENFILES /Disconnect /S system /U username /ID 5\n"
|
|
IDS_HELP_LINE_END " OPENFILES /Disconnect /S system /U username /P password /ID *\n"
|
|
END
|
|
|
|
STRINGTABLE DISCARDABLE
|
|
BEGIN
|
|
IDS_SUCCESS_DISCONNECT "\nSUCCESS: The connection to the open file ""%s"" has been terminated.\n"
|
|
END
|
|
|
|
STRINGTABLE DISCARDABLE
|
|
BEGIN
|
|
IDS_HELP_MAIN1 "\nOPENFILES /parameter [arguments]\n\n"
|
|
IDS_HELP_MAIN2 "Description:\n"
|
|
IDS_HELP_MAIN3 " Enables an administrator to list or disconnect files and folders\n"
|
|
IDS_HELP_MAIN4 " that have been opened on a system.\n\n"
|
|
IDS_HELP_MAIN5 "Parameter List:\n"
|
|
IDS_HELP_MAIN6 " /Disconnect Disconnects one or more open files.\n\n"
|
|
IDS_HELP_MAIN7 " /Query Displays files opened locally or from shared\n"
|
|
IDS_HELP_MAIN8 " folders.\n\n"
|
|
IDS_HELP_MAIN9 " /Local Enables / Disables the display of local open files.\n\n"
|
|
IDS_HELP_MAIN10 " /? Displays this help message.\n\n"
|
|
IDS_HELP_MAIN11 "Examples:\n"
|
|
IDS_HELP_MAIN12 " OPENFILES /Disconnect /?\n"
|
|
IDS_HELP_MAIN13 " OPENFILES /Query /?\n"
|
|
IDS_HELP_MAIN_END " OPENFILES /Local /?\n"
|
|
END
|
|
|
|
STRINGTABLE DISCARDABLE
|
|
BEGIN
|
|
IDS_HELP_QUERY1 "\nOPENFILES /Query [/S system [/U username [/P [password]]]]\n"
|
|
IDS_HELP_QUERY2 " [/FO format] [/NH] [/V]\n\n"
|
|
IDS_HELP_QUERY3 "Description:\n"
|
|
IDS_HELP_QUERY4 " Enables an administrator to display a list of files and folders\n"
|
|
IDS_HELP_QUERY5 " that have been remotely opened on a system.\n\n"
|
|
IDS_HELP_QUERY6 "Parameter List:\n"
|
|
IDS_HELP_QUERY7 " /S system Specifies the remote system to connect to.\n\n"
|
|
IDS_HELP_QUERY8 " /U [domain\]user Specifies the user context under which\n"
|
|
IDS_HELP_QUERY9 " the command should execute.\n\n"
|
|
IDS_HELP_QUERY10 " /P [password] Specifies the password for the given user\n"
|
|
IDS_HELP_QUERY11 " context.\n\n"
|
|
IDS_HELP_QUERY12 " /FO format Specifies the format in which the output is\n"
|
|
IDS_HELP_QUERY13 " to be displayed.\n"
|
|
IDS_HELP_QUERY14 " Valid values: ""TABLE"",""LIST"",""CSV"".\n\n"
|
|
IDS_HELP_QUERY15 " /NH Specifies that the ""Column Header"" should\n"
|
|
IDS_HELP_QUERY16 " not be displayed.\n"
|
|
IDS_HELP_QUERY17 " Valid only for ""TABLE"" and ""CSV"" formats.\n\n"
|
|
IDS_HELP_QUERY18 " /V Specifies that verbose output is displayed\n\n"
|
|
IDS_HELP_QUERY19 ""
|
|
IDS_HELP_QUERY20 " /? Displays this help message.\n\n"
|
|
IDS_HELP_QUERY21 "Examples:\n"
|
|
IDS_HELP_QUERY22 " OPENFILES /Query /?\n"
|
|
IDS_HELP_QUERY23 " OPENFILES /Query\n"
|
|
IDS_HELP_QUERY24 " OPENFILES /Query /FO csv /NH\n"
|
|
IDS_HELP_QUERY25 " OPENFILES /Query /FO LIST /V\n"
|
|
IDS_HELP_QUERY_END " OPENFILES /Query /S system /U username /P password /NH \n"
|
|
END
|
|
|
|
STRINGTABLE DISCARDABLE
|
|
BEGIN
|
|
IDS_NOACCESS "No Access."
|
|
IDS_NA "N/A"
|
|
IDS_DOT_EOL ".\n"
|
|
IDS_TYPE_Q_HELP "Type ""%s /Query /?"" for usage.\n"
|
|
IDS_TYPE_D_HELP "Type ""%s /Disconnect /?"" for usage.\n"
|
|
END
|
|
|
|
STRINGTABLE DISCARDABLE
|
|
BEGIN
|
|
IDS_HELP_LOCAL1 "\nOPENFILES /Local [ ON | OFF ]\n\n"
|
|
IDS_HELP_LOCAL2 "Description:\n"
|
|
IDS_HELP_LOCAL3 " Allows an administrator to enable or disable the system global flag\n"
|
|
IDS_HELP_LOCAL4 " 'maintain objects list' which tracks local file handles. Changes\n"
|
|
IDS_HELP_LOCAL5 " made by this switch will take effect only after restarting the\n"
|
|
IDS_HELP_LOCAL6 " system.\n\n"
|
|
IDS_HELP_LOCAL7 " Note: Enabling this flag reduces system performance.\n\n"
|
|
IDS_HELP_LOCAL8 "Parameter List:\n"
|
|
IDS_HELP_LOCAL9 " /? Displays this help message.\n\n"
|
|
IDS_HELP_LOCAL10 "Examples:\n"
|
|
IDS_HELP_LOCAL11 " OPENFILES /Local /?\n"
|
|
IDS_HELP_LOCAL12 " OPENFILES /Local\n"
|
|
IDS_HELP_LOCAL13 " OPENFILES /Local ON\n"
|
|
IDS_HELP_LOCAL_END " OPENFILES /Local OFF\n"
|
|
END
|
|
|
|
//
|
|
// Version resources
|
|
//
|
|
#include <ntverp.h>
|
|
#define VER_FILETYPE VFT_APP
|
|
#define VER_FILESUBTYPE VFT2_UNKNOWN
|
|
#define VER_FILEDESCRIPTION_STR "Displays the current open files list"
|
|
#define VER_INTERNALNAME_STR "openfiles.exe"
|
|
#define VER_ORIGINALFILENAME_STR "opnfiles.exe"
|
|
#include <common.ver>
|
|
|
|
|