---- Original Message ----
From: vefatica
To:
[email protected]
Sent: Tuesday, 2011. June 7. 10:25
Subject: RE: [Support-t-2914] WHICH?
| On Tue, 07 Jun 2011 03:58:38 -0400, dim <> wrote:
|
|| If u:\ isn't in your PATH, and D:\uty is, then yes.
|
| u:\ and d:\uty are the same thing (SUBST). I should have conducted
| the test
| like this. Sorry for the confusion.
|
|
| Code:
| v:\> which wmiu*
| wmiu* is an external : D:\uty\wmiu*.exe
|
| v:\> which /a wmiu*
| wmiu* is an external : D:\uty\wmiuptime.exe
|
| v:\> d:\uty\wmiuptime.exe
|
| Time: 2011/06/07 10:13:15
| Boot: 2011/04/23 16:35:59
| Uptime: 44 days 13 hours 37 minutes 16 seconds
| It's the presence of
| the "*" when WHICH names the file that I'm wondering about.
| I figured it would give the actual name of the match as it does with
| "/A".
I found similar behavior.
command is an external : C:\WINDOWS\system32\command.com
command is an external : C:\WINDOWS\system32\command.com
comman* is an external : C:\WINDOWS\system32\comman*.com
comman* is an external : C:\WINDOWS\system32\comman*.com
comma* is an external : C:\WINDOWS\system32\comma*.com
comma* is an external : C:\WINDOWS\system32\comma*.com
comman? is an external : C:\WINDOWS\system32\comman?.com
comman? is an external : C:\WINDOWS\system32\comman?.com
comma?? is an external : C:\WINDOWS\system32\comma??.com
comma?? is an external : C:\WINDOWS\system32\comma??.com
com*nd is an external : C:\WINDOWS\system32\com*nd.com
I found similar behavior with @SEARCH[]:
C:\WINDOWS\system32\com*nd.com
I finally got a correct result thus:
> echo %@expand[%@search[com*nd]]
C:\WINDOWS\system32\command.com
I also run a test: "which /a new?al"; it listed all aliases matching the ? with their unique names and definitions, and listed the matching batchfile thus:
new?al is a batch file : F:\LOC\NEWBAL.BTM
Summary
- Wildcards are properly expanded in alias names and correct values listed
- If the wildcard matches more than one FILE (batch or external) the WHICH parameter retains the wildcard, but the real filenames are displayed
- If the wildcard matches one file, WHICH /A sometimes reports the file with wildcard in its name, sometimes with real names(each instance repeatable, rule not discovered); without /A always with wildcard.
IMHO filenames reported should never contain wildcards!
--
Steve