Leaked source code of windows server 2003
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

  1. #include "resource.h"
  2. #include "windows.h"
  3. #include "cmdlineres.h"
  4. #include "cmdline.rc"
  5. /////////////////////////////////////////////////////////////////////////////
  6. // String Table
  7. //
  8. STRINGTABLE DISCARDABLE
  9. BEGIN
  10. IDS_FAILURE "FAILURE: "
  11. IDS_ERROR_DISCONNECT "ERROR: Could not disconnect the open file ""%s"".\n"
  12. IDS_INVALID_SYNTAX "Invalid syntax.\nType ""%s /?"" for usage.\n"
  13. IDS_AUTHENTICATION_FAILURE "ERROR: Could not connect to remote server.\n"
  14. IDS_INVALID_SERVER_NAME "Invalid server name.\n"
  15. IDS_HEADER_NOT_ALLOWED "ERROR: Invalid Syntax. /NH option is only allowed for TABLE and CSV formats.\n"
  16. IDS_ERROR_USERNAME_BUT_NOMACHINE "ERROR: Invalid Syntax. /U option can be specified only when /S option is specified.\n"
  17. IDS_ERROR_PASSWORD_BUT_NOUSERNAME "ERROR: Invalid Syntax. /P option can be specified only when /U option is specified.\n"
  18. IDS_NO_ID_ACC_OF "ERROR: Invalid Syntax. No /ID or /A or /O parameter present.\n"
  19. IDS_ERROR_ID "ERROR: Invalid ID.\n"
  20. IDS_ID_SHOW_ERROR "ERROR: "
  21. IDS_INTERNAL_FAILURE "ERROR: Unable to retrieve data.\n"
  22. IDS_INVALID_CREDENTIALS "ERROR: Could not connect to the specified system with the given credentials.\n"
  23. IDS_SERVER_EMPTY "ERROR: Invalid syntax. System name cannot be empty.\n"
  24. IDS_USERNAME_EMPTY "ERROR: Invalid syntax. User name cannot be empty.\n"
  25. IDS_INVALID_OS "ERROR: The target system must be running Windows XP or above.\n"
  26. IDS_ACCESSBY_EMPTY "ERROR: Invalid syntax. Accessed by cannot be empty.\n"
  27. IDS_OPEN_FILE_EMPTY "ERROR: Invalid syntax. File name cannot be empty.\n"
  28. IDS_ERROR_SYSTEM_INFO "ERROR: Unable to get system type information.\n"
  29. IDS_ERROR_VERSION_MISMATCH "ERROR: The target system must be running a 32 bit OS.\n"
  30. IDS_REMOTE_NOT_SUPPORTED "ERROR: Remote open files is not supported for 64 bit machines.\n"
  31. IDS_ERROR_VERSION_MISMATCH1 "ERROR: The target system must be running a 64 bit OS.\n"
  32. IDS_REMOTE_NOT_SUPPORTED1 "ERROR: Remote open files is not supported for 32 bit machines.\n"
  33. IDS_USER_NOT_ADMIN "ERROR: Logged-on user does not have administrative privilege.\n"
  34. IDS_USER_INVALID_ADMIN "ERROR: Invalid username.\n"
  35. IDS_FILENAME_INVALID "ERROR: Invalid open file name.\n"
  36. END
  37. STRINGTABLE DISCARDABLE
  38. BEGIN
  39. IDS_SUCCESS "\nSUCCESS: "
  40. IDS_NO_OPENFILES "\nINFO: No shared open files found.\n"
  41. IDS_NO_D_OPENFILES "\nINFO: There are no shared open files found with the specified criteria.\n"
  42. END
  43. STRINGTABLE DISCARDABLE
  44. BEGIN
  45. IDS_UTILITY_NAME "OPENFILES"
  46. IDS_OPENMODE_OPTION "read|write|read/write|*"
  47. IDS_STRING_HOSTNAME "Hostname"
  48. IDS_STRING_ID "ID"
  49. IDS_STRING_ACCESSED_BY "Accessed By"
  50. IDS_STRING_PID "PID"
  51. IDS_STRING_TYPE "Type"
  52. IDS_STRING_LOCK "#Locks"
  53. IDS_STRING_OPEN_MODE "Open Mode"
  54. IDS_STRING_OPEN_FILE "Open File (Path\\executable)"
  55. IDS_STRING_WINDOWS "Windows"
  56. IDS_READ "Read"
  57. IDS_WRITE "Write"
  58. IDS_READ_WRITE "Write + Read"
  59. IDS_FORMAT_OPTIONS "list|csv|table"
  60. IDS_LIST "LIST"
  61. IDS_CSV "CSV"
  62. IDS_READ_SLASH_WRITE "Read/Write"
  63. IDS_WRITE_SLASH_READ "Write/Read"
  64. IDS_MAC_OS "Macintosh"
  65. IDS_LOCAL_OPEN_FILES "\nFiles Opened Locally:\n"
  66. IDS_LOCAL_OPEN_FILES_SP1 "---------------------\n"
  67. IDS_SHARED_OPEN_FILES "\n\nFiles opened remotely via local share points:\n"
  68. IDS_LOCAL_OPEN_FILES_SP2 "---------------------------------------------\n"
  69. IDS_STRING_PROCESS_ID "ProcessID"
  70. IDS_STRING_PROCESS_NAME "Process Name"
  71. IDS_FILE_TYPE "Type"
  72. IDS_LOCAL_OPTION "on|off"
  73. IDS_LOCAL_ON "ON"
  74. IDS_LOCAL_OFF "OFF"
  75. END
  76. STRINGTABLE DISCARDABLE
  77. BEGIN
  78. IDS_ID_SHOW_WARNING "WARNING: "
  79. IDS_LOCAL_SYSTEM "WARNING: Ignoring the user credentials for the local connection.\n"
  80. IDS_LOCAL_NEEDS_TO_SET1 "\nINFO: The system global flag 'maintain objects list' needs\n"
  81. IDS_LOCAL_NEEDS_TO_SET2 " to be enabled to see local opened files.\n"
  82. IDS_LOCAL_NEEDS_TO_SET3 " See Openfiles /? for more information.\n"
  83. 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"
  84. 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"
  85. IDS_LOCAL_FLG_ALREADY_SET "\nINFO: The system global flag 'maintain objects list' is currently enabled.\n"
  86. IDS_LOCAL_FLG_ALREADY_RESET "\nINFO: The system global flag 'maintain objects list' is currently disabled.\n"
  87. END
  88. STRINGTABLE DISCARDABLE
  89. BEGIN
  90. IDS_HELP_LINE1 "\nOPENFILES /Disconnect [/S system [/U username [/P [password]]]]\n"
  91. IDS_HELP_LINE2 " {[/ID id] [/A accessedby] [/O openmode]}\n"
  92. IDS_HELP_LINE3 " [/OP openfile]\n\n"
  93. IDS_HELP_LINE5 "Description:\n"
  94. IDS_HELP_LINE6 " Enables an administrator to disconnect files and folders that\n"
  95. IDS_HELP_LINE7 " have been opened remotely through a shared folder.\n\n"
  96. IDS_HELP_LINE8 "Parameter List:\n"
  97. IDS_HELP_LINE9 " /S system Specifies the remote system to connect to.\n\n"
  98. IDS_HELP_LINE10 " /U [domain\]user Specifies the user context under which the\n"
  99. IDS_HELP_LINE11 " command should execute.\n\n"
  100. IDS_HELP_LINE12 " /P [password] Specifies the password for the given user\n"
  101. IDS_HELP_LINE13 " context.\n\n"
  102. IDS_HELP_LINE14 " /ID id Specifies to disconnect open files by file ID.\n"
  103. IDS_HELP_LINE15 " The ""*"" wildcard may be used.\n\n"
  104. IDS_HELP_LINE16 " /A accessedby Specifies to disconnect all open files by\n"
  105. IDS_HELP_LINE17 " ""accessedby"" value. The ""*"" wildcard\n"
  106. IDS_HELP_LINE18 " may be used.\n\n"
  107. IDS_HELP_LINE19 " /O openmode Specifies to disconnect all open files by\n"
  108. IDS_HELP_LINE20 " ""openmode"" value. Valid values are Read,\n"
  109. IDS_HELP_LINE21 " Write or Read/Write. The ""*"" wildcard\n"
  110. IDS_HELP_LINE22 " may be used.\n\n"
  111. IDS_HELP_LINE23 ""
  112. IDS_HELP_LINE24 ""
  113. IDS_HELP_LINE25 ""
  114. IDS_HELP_LINE26 " /OP openfile Specifies to disconnect all open file\n"
  115. IDS_HELP_LINE27 " connections created by a specific ""open\n"
  116. IDS_HELP_LINE28 " file"" name. The ""*"" wildcard may be used.\n\n"
  117. IDS_HELP_LINE29 " /? Displays this help message.\n\n"
  118. IDS_HELP_LINE30 "Examples:\n"
  119. IDS_HELP_LINE31 " OPENFILES /Disconnect /?\n"
  120. IDS_HELP_LINE32 " OPENFILES /Disconnect /ID 1\n"
  121. IDS_HELP_LINE33 " OPENFILES /Disconnect /A username\n"
  122. IDS_HELP_LINE34 " OPENFILES /Disconnect /O Read/Write\n"
  123. IDS_HELP_LINE35 " OPENFILES /Disconnect /OP ""c:\\My Documents\\somedoc.doc"" /ID 234\n"
  124. IDS_HELP_LINE36 " OPENFILES /Disconnect /S system /U username /ID 5\n"
  125. IDS_HELP_LINE_END " OPENFILES /Disconnect /S system /U username /P password /ID *\n"
  126. END
  127. STRINGTABLE DISCARDABLE
  128. BEGIN
  129. IDS_SUCCESS_DISCONNECT "\nSUCCESS: The connection to the open file ""%s"" has been terminated.\n"
  130. END
  131. STRINGTABLE DISCARDABLE
  132. BEGIN
  133. IDS_HELP_MAIN1 "\nOPENFILES /parameter [arguments]\n\n"
  134. IDS_HELP_MAIN2 "Description:\n"
  135. IDS_HELP_MAIN3 " Enables an administrator to list or disconnect files and folders\n"
  136. IDS_HELP_MAIN4 " that have been opened on a system.\n\n"
  137. IDS_HELP_MAIN5 "Parameter List:\n"
  138. IDS_HELP_MAIN6 " /Disconnect Disconnects one or more open files.\n\n"
  139. IDS_HELP_MAIN7 " /Query Displays files opened locally or from shared\n"
  140. IDS_HELP_MAIN8 " folders.\n\n"
  141. IDS_HELP_MAIN9 " /Local Enables / Disables the display of local open files.\n\n"
  142. IDS_HELP_MAIN10 " /? Displays this help message.\n\n"
  143. IDS_HELP_MAIN11 "Examples:\n"
  144. IDS_HELP_MAIN12 " OPENFILES /Disconnect /?\n"
  145. IDS_HELP_MAIN13 " OPENFILES /Query /?\n"
  146. IDS_HELP_MAIN_END " OPENFILES /Local /?\n"
  147. END
  148. STRINGTABLE DISCARDABLE
  149. BEGIN
  150. IDS_HELP_QUERY1 "\nOPENFILES /Query [/S system [/U username [/P [password]]]]\n"
  151. IDS_HELP_QUERY2 " [/FO format] [/NH] [/V]\n\n"
  152. IDS_HELP_QUERY3 "Description:\n"
  153. IDS_HELP_QUERY4 " Enables an administrator to display a list of files and folders\n"
  154. IDS_HELP_QUERY5 " that have been remotely opened on a system.\n\n"
  155. IDS_HELP_QUERY6 "Parameter List:\n"
  156. IDS_HELP_QUERY7 " /S system Specifies the remote system to connect to.\n\n"
  157. IDS_HELP_QUERY8 " /U [domain\]user Specifies the user context under which\n"
  158. IDS_HELP_QUERY9 " the command should execute.\n\n"
  159. IDS_HELP_QUERY10 " /P [password] Specifies the password for the given user\n"
  160. IDS_HELP_QUERY11 " context.\n\n"
  161. IDS_HELP_QUERY12 " /FO format Specifies the format in which the output is\n"
  162. IDS_HELP_QUERY13 " to be displayed.\n"
  163. IDS_HELP_QUERY14 " Valid values: ""TABLE"",""LIST"",""CSV"".\n\n"
  164. IDS_HELP_QUERY15 " /NH Specifies that the ""Column Header"" should\n"
  165. IDS_HELP_QUERY16 " not be displayed.\n"
  166. IDS_HELP_QUERY17 " Valid only for ""TABLE"" and ""CSV"" formats.\n\n"
  167. IDS_HELP_QUERY18 " /V Specifies that verbose output is displayed\n\n"
  168. IDS_HELP_QUERY19 ""
  169. IDS_HELP_QUERY20 " /? Displays this help message.\n\n"
  170. IDS_HELP_QUERY21 "Examples:\n"
  171. IDS_HELP_QUERY22 " OPENFILES /Query /?\n"
  172. IDS_HELP_QUERY23 " OPENFILES /Query\n"
  173. IDS_HELP_QUERY24 " OPENFILES /Query /FO csv /NH\n"
  174. IDS_HELP_QUERY25 " OPENFILES /Query /FO LIST /V\n"
  175. IDS_HELP_QUERY_END " OPENFILES /Query /S system /U username /P password /NH \n"
  176. END
  177. STRINGTABLE DISCARDABLE
  178. BEGIN
  179. IDS_NOACCESS "No Access."
  180. IDS_NA "N/A"
  181. IDS_DOT_EOL ".\n"
  182. IDS_TYPE_Q_HELP "Type ""%s /Query /?"" for usage.\n"
  183. IDS_TYPE_D_HELP "Type ""%s /Disconnect /?"" for usage.\n"
  184. END
  185. STRINGTABLE DISCARDABLE
  186. BEGIN
  187. IDS_HELP_LOCAL1 "\nOPENFILES /Local [ ON | OFF ]\n\n"
  188. IDS_HELP_LOCAL2 "Description:\n"
  189. IDS_HELP_LOCAL3 " Allows an administrator to enable or disable the system global flag\n"
  190. IDS_HELP_LOCAL4 " 'maintain objects list' which tracks local file handles. Changes\n"
  191. IDS_HELP_LOCAL5 " made by this switch will take effect only after restarting the\n"
  192. IDS_HELP_LOCAL6 " system.\n\n"
  193. IDS_HELP_LOCAL7 " Note: Enabling this flag reduces system performance.\n\n"
  194. IDS_HELP_LOCAL8 "Parameter List:\n"
  195. IDS_HELP_LOCAL9 " /? Displays this help message.\n\n"
  196. IDS_HELP_LOCAL10 "Examples:\n"
  197. IDS_HELP_LOCAL11 " OPENFILES /Local /?\n"
  198. IDS_HELP_LOCAL12 " OPENFILES /Local\n"
  199. IDS_HELP_LOCAL13 " OPENFILES /Local ON\n"
  200. IDS_HELP_LOCAL_END " OPENFILES /Local OFF\n"
  201. END
  202. //
  203. // Version resources
  204. //
  205. #include <ntverp.h>
  206. #define VER_FILETYPE VFT_APP
  207. #define VER_FILESUBTYPE VFT2_UNKNOWN
  208. #define VER_FILEDESCRIPTION_STR "Displays the current open files list"
  209. #define VER_INTERNALNAME_STR "openfiles.exe"
  210. #define VER_ORIGINALFILENAME_STR "opnfiles.exe"
  211. #include <common.ver>