Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45343
The installers from that bugreport use this (in Win7 mode) to check if wmic is present. (The installer still fails after this patch as findstr.exe lacks some support: "match_regexp character ranges (i.e. [abc], [^a-z]) are not supported")
-- v2: wmic: Add a basic help option "/?".
From: Louis Lenders xerox.xerox2000x@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45343
The installers from that bugreport use this (in Win7 mode) to check if wmic is present. (The installer still fails after this patch as findstr.exe lacks some support: "match_regexp character ranges (i.e. [abc], [^a-z]) are not supported")
v2: Improve help message. --- programs/wmic/main.c | 6 ++++++ programs/wmic/wmic.h | 1 + programs/wmic/wmic.rc | 1 + 3 files changed, 8 insertions(+)
diff --git a/programs/wmic/main.c b/programs/wmic/main.c index f71c54e8071..9d1748ca753 100644 --- a/programs/wmic/main.c +++ b/programs/wmic/main.c @@ -354,6 +354,12 @@ static int process_args( int argc, WCHAR *argv[] ) const WCHAR *class; int i;
+ if (!wcscmp( argv[0], L"/?" )) + { + output_error( STRING_HELP ); + return 0; + } + for (i = 0; i < argc && argv[i][0] == '/'; i++) WINE_FIXME( "switch %s not supported\n", debugstr_w(argv[i]) );
diff --git a/programs/wmic/wmic.h b/programs/wmic/wmic.h index b5779bd6eb9..fff3bd969c8 100644 --- a/programs/wmic/wmic.h +++ b/programs/wmic/wmic.h @@ -23,3 +23,4 @@ #define STRING_INVALID_QUERY 103 #define STRING_INVALID_PATH 104 #define STRING_USAGE 105 +#define STRING_HELP 106 diff --git a/programs/wmic/wmic.rc b/programs/wmic/wmic.rc index 80d76ac1447..431bbf6e474 100644 --- a/programs/wmic/wmic.rc +++ b/programs/wmic/wmic.rc @@ -29,4 +29,5 @@ STRINGTABLE STRING_INVALID_QUERY, "Error: Invalid query\n" STRING_INVALID_PATH, "Error: Invalid syntax for PATH\n" STRING_USAGE, "Supply a command\n" + STRING_HELP, "Example usage: wmic ALIAS get PROPERTY[,PROPERTY2,...]\n" }
On Fri Sep 19 14:15:30 2025 +0000, Louis Lenders wrote:
changed this line in [version 2 of the diff](/wine/wine/-/merge_requests/9007/diffs?diff_id=210722&start_sha=4c1a07cab3067080bc639b6f3283b45ad8666a14#5215423ef926bed91dea7782a33e637b9c4c1ddf_32_32)
I've changed it.
This merge request was approved by Hans Leidekker.