New essay: whereis utility

The whereis utility is often useful.  The problem in Windows is that there are many
different search algorithms, based on the platform, Windows release, Service Packs
installed, etc., so any program that works like the Unix program, that is, which simulates
the search path, is likely to fail, particularly in light of the possible future changes
that may occur.  This program uses the LoadLibraryEx call to search the load path.

www.flounder.com/whereis.htm

(It took almost more time to write it up and create the zipfile than to write the program
itself...)
				joe
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
3/8/2006 4:05:40 AM
vc.mfc 33608 articles. 0 followers. Follow

7 Replies
321 Views

Similar Articles

[PageSpeed] 29

"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
news:tpls02989k8k4o7lbijnn66252mgr1v965@4ax.com...
| The whereis utility is often useful.  The problem in Windows is that there 
are many
| different search algorithms, based on the platform, Windows release, 
Service Packs
| installed, etc., so any program that works like the Unix program, that is, 
which simulates
| the search path, is likely to fail, particularly in light of the possible 
future changes
| that may occur.  This program uses the LoadLibraryEx call to search the 
load path.
|
| www.flounder.com/whereis.htm
|
| (It took almost more time to write it up and create the zipfile than to 
write the program
| itself...)
| joe
| Joseph M. Newcomer [MVP]
| email: newcomer@flounder.com
| Web: http://www.flounder.com
| MVP Tips: http://www.flounder.com/mvp_tips.htm

Thanks, but I've been using this for years, without any need for updates:
#include <Afx.h>
#include <io.h>
#include <direct.h>

typedef struct _finddata_t FINDDATA, *PFINDDATA;

int main(int argc, TCHAR *argv[])
{
 CStringArray rgStrPaths;
 CStringArray rgStrPExts;
 CString   strFileName;
 LPTSTR   pszEnvPath = getenv("PATH"), pszVar;
 LPTSTR   pszPathExt = getenv("PATHEXT"); // Order or precedence

 if(2 > argc)
 {
  printf("usage: which filename (.COM;.EXE;.BAT;.CMD)\n\tshows which 
executable is found in path\n");
  return ERROR_SUCCESS;
 }

 if(NULL == pszEnvPath) // If getenv fails (rare if ever) - user has no path
 {
  // I'm going to leak this, because this tool terminates soon anyway.
  pszEnvPath = _getcwd(NULL, sizeof(TCHAR) * MAX_PATH);
  if(NULL == pszEnvPath)
  {
   printf("No path\n");
   return ERROR_PATH_NOT_FOUND;
  }
  else
   rgStrPaths.Add(pszEnvPath);
 }

 if(NULL == pszPathExt)
 {            // Not available in environment?
  pszPathExt = ".COM;.EXE;.BAT;.CMD";   // Set default precedence
//  printf("Default precedence: %s\n", pszPathExt);
 }
// else
//  printf("Precedence: %s\n", pszPathExt);

 // Get the CWD to search first
 if(0 == rgStrPaths.GetSize()) // No cwd yet?
 {
  strFileName.Format("%s\\", _getcwd(NULL, sizeof(TCHAR) * MAX_PATH));
  rgStrPaths.Add(strFileName);
 }

 pszVar = strtok(pszEnvPath, ";");
 while(NULL != pszVar)
 {
  strFileName = pszVar;

  if(strFileName.Right(1) != '\\')
   rgStrPaths.Add(strFileName + "\\");
  else
   rgStrPaths.Add(strFileName);

  pszVar = strtok(NULL, ";");
 }

 // Guaranteed to have one or more path variables to search, load precedence 
of executable extensions
 pszVar = strtok(pszPathExt, ";");
 while(NULL != pszVar)
 {
  rgStrPExts.Add(pszVar);
  pszVar = strtok(NULL, ";");
 }

 FINDDATA fd;
 int   i;

 for(i = 0; i < rgStrPaths.GetSize(); i++) // Paths loop
 {
  // See if the user gave us an extension
  if(NULL != strchr(argv[1], '.'))
  {
   // Extension is user supplied:
   strFileName.Format("%s%s", (LPCTSTR) rgStrPaths.GetAt(i), argv[1]);
   if(-1 != _findfirst((LPCTSTR) strFileName, &fd))
   {
    // Found it, tell the user where and what (could have used a wildcard)
    strFileName.Format("%s%s", (LPCTSTR) rgStrPaths.GetAt(i), fd.name);
    printf("%s\n\n", (LPCTSTR) strFileName);
    return ERROR_SUCCESS;
   }
  }
  else
  {
   // No user extension:  look through precedence
   for(int x = 0; x < rgStrPExts.GetSize(); x++)
   {
    strFileName.Format("%s%s%s",
     (LPCTSTR) rgStrPaths.GetAt(i),
     argv[1],
     (LPCTSTR) rgStrPExts.GetAt(x) );

    if(-1 != _findfirst((LPCTSTR) strFileName, &fd))
    {
     // Found it, tell the user where and what (could have used a wildcard)
     strFileName.Format("%s%s",
      (LPCTSTR) rgStrPaths.GetAt(i),
      fd.name );

     printf("%s\n\n", (LPCTSTR) strFileName);
     return ERROR_SUCCESS;
    }
   }
  }
 }

 printf("%s not found in path\n\n", argv[1]);
 return ERROR_SUCCESS;
}


I've also done tail (I called it ScrollFile) if you would like to see that 
too,
- Ed.

0
Anon3258 (180)
3/8/2006 5:29:51 AM
Ah, but you are simulating what you THINK is happening.  In fact, that is not what
ACTUALLY happens.  _getcwd gives the current working directory, but the search strategy
involving the current working directory changes with various releases and service packs.
You also don't account for the "known DLLs" feature if you are asking where a DLL is
found.  So if you ask where "kernel32.dll" is, for example, your code gives an erroneous
answer.  See the latest posting of my article,, where I demonstrate that your code does
not work correctly in XP Pro SP 2.

You may have been "using it for years" but in fact it doesn't work correctly.  And that's
the point of my post.
				joe

On Tue, 7 Mar 2006 21:29:51 -0800, "Ed Weir \(ComCast\)" <Anon@Maus.duh> wrote:

>"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
>news:tpls02989k8k4o7lbijnn66252mgr1v965@4ax.com...
>| The whereis utility is often useful.  The problem in Windows is that there 
>are many
>| different search algorithms, based on the platform, Windows release, 
>Service Packs
>| installed, etc., so any program that works like the Unix program, that is, 
>which simulates
>| the search path, is likely to fail, particularly in light of the possible 
>future changes
>| that may occur.  This program uses the LoadLibraryEx call to search the 
>load path.
>|
>| www.flounder.com/whereis.htm
>|
>| (It took almost more time to write it up and create the zipfile than to 
>write the program
>| itself...)
>| joe
>| Joseph M. Newcomer [MVP]
>| email: newcomer@flounder.com
>| Web: http://www.flounder.com
>| MVP Tips: http://www.flounder.com/mvp_tips.htm
>
>Thanks, but I've been using this for years, without any need for updates:
>#include <Afx.h>
>#include <io.h>
>#include <direct.h>
>
>typedef struct _finddata_t FINDDATA, *PFINDDATA;
>
>int main(int argc, TCHAR *argv[])
>{
> CStringArray rgStrPaths;
> CStringArray rgStrPExts;
> CString   strFileName;
> LPTSTR   pszEnvPath = getenv("PATH"), pszVar;
> LPTSTR   pszPathExt = getenv("PATHEXT"); // Order or precedence
>
> if(2 > argc)
> {
>  printf("usage: which filename (.COM;.EXE;.BAT;.CMD)\n\tshows which 
>executable is found in path\n");
>  return ERROR_SUCCESS;
> }
>
> if(NULL == pszEnvPath) // If getenv fails (rare if ever) - user has no path
> {
>  // I'm going to leak this, because this tool terminates soon anyway.
>  pszEnvPath = _getcwd(NULL, sizeof(TCHAR) * MAX_PATH);
>  if(NULL == pszEnvPath)
>  {
>   printf("No path\n");
>   return ERROR_PATH_NOT_FOUND;
>  }
>  else
>   rgStrPaths.Add(pszEnvPath);
> }
>
> if(NULL == pszPathExt)
> {            // Not available in environment?
>  pszPathExt = ".COM;.EXE;.BAT;.CMD";   // Set default precedence
>//  printf("Default precedence: %s\n", pszPathExt);
> }
>// else
>//  printf("Precedence: %s\n", pszPathExt);
>
> // Get the CWD to search first
> if(0 == rgStrPaths.GetSize()) // No cwd yet?
> {
>  strFileName.Format("%s\\", _getcwd(NULL, sizeof(TCHAR) * MAX_PATH));
>  rgStrPaths.Add(strFileName);
> }
>
> pszVar = strtok(pszEnvPath, ";");
> while(NULL != pszVar)
> {
>  strFileName = pszVar;
>
>  if(strFileName.Right(1) != '\\')
>   rgStrPaths.Add(strFileName + "\\");
>  else
>   rgStrPaths.Add(strFileName);
>
>  pszVar = strtok(NULL, ";");
> }
>
> // Guaranteed to have one or more path variables to search, load precedence 
>of executable extensions
> pszVar = strtok(pszPathExt, ";");
> while(NULL != pszVar)
> {
>  rgStrPExts.Add(pszVar);
>  pszVar = strtok(NULL, ";");
> }
>
> FINDDATA fd;
> int   i;
>
> for(i = 0; i < rgStrPaths.GetSize(); i++) // Paths loop
> {
>  // See if the user gave us an extension
>  if(NULL != strchr(argv[1], '.'))
>  {
>   // Extension is user supplied:
>   strFileName.Format("%s%s", (LPCTSTR) rgStrPaths.GetAt(i), argv[1]);
>   if(-1 != _findfirst((LPCTSTR) strFileName, &fd))
>   {
>    // Found it, tell the user where and what (could have used a wildcard)
>    strFileName.Format("%s%s", (LPCTSTR) rgStrPaths.GetAt(i), fd.name);
>    printf("%s\n\n", (LPCTSTR) strFileName);
>    return ERROR_SUCCESS;
>   }
>  }
>  else
>  {
>   // No user extension:  look through precedence
>   for(int x = 0; x < rgStrPExts.GetSize(); x++)
>   {
>    strFileName.Format("%s%s%s",
>     (LPCTSTR) rgStrPaths.GetAt(i),
>     argv[1],
>     (LPCTSTR) rgStrPExts.GetAt(x) );
>
>    if(-1 != _findfirst((LPCTSTR) strFileName, &fd))
>    {
>     // Found it, tell the user where and what (could have used a wildcard)
>     strFileName.Format("%s%s",
>      (LPCTSTR) rgStrPaths.GetAt(i),
>      fd.name );
>
>     printf("%s\n\n", (LPCTSTR) strFileName);
>     return ERROR_SUCCESS;
>    }
>   }
>  }
> }
>
> printf("%s not found in path\n\n", argv[1]);
> return ERROR_SUCCESS;
>}
>
>
>I've also done tail (I called it ScrollFile) if you would like to see that 
>too,
>- Ed.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
3/8/2006 3:31:01 PM
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
news:5ost02dd259h4onf5n485v3k6e7671mvjc@4ax.com...
| Ah, but you are simulating what you THINK is happening.  In fact, that is 
not what
| ACTUALLY happens.  _getcwd gives the current working directory, but the 
search strategy
| involving the current working directory changes with various releases and 
service packs.
| You also don't account for the "known DLLs" feature if you are asking 
where a DLL is
| found.  So if you ask where "kernel32.dll" is, for example, your code 
gives an erroneous
| answer.  See the latest posting of my article,, where I demonstrate that 
your code does
| not work correctly in XP Pro SP 2.
|
| You may have been "using it for years" but in fact it doesn't work 
correctly.  And that's
| the point of my post.
| joe
|
| On Tue, 7 Mar 2006 21:29:51 -0800, "Ed Weir \(ComCast\)" <Anon@Maus.duh> 
wrote:
|
| >"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
| >news:tpls02989k8k4o7lbijnn66252mgr1v965@4ax.com...
| >| The whereis utility is often useful.  The problem in Windows is that 
there
| >are many
| >| different search algorithms, based on the platform, Windows release,
| >Service Packs
| >| installed, etc., so any program that works like the Unix program, that 
is,
| >which simulates
| >| the search path, is likely to fail, particularly in light of the 
possible
| >future changes
| >| that may occur.  This program uses the LoadLibraryEx call to search the
| >load path.
| >|
| >| www.flounder.com/whereis.htm
| >|
| >| (It took almost more time to write it up and create the zipfile than to
| >write the program
| >| itself...)
| >| joe
| >| Joseph M. Newcomer [MVP]
| >| email: newcomer@flounder.com
| >| Web: http://www.flounder.com
| >| MVP Tips: http://www.flounder.com/mvp_tips.htm
| >
| >Thanks, but I've been using this for years, without any need for updates:
| >#include <Afx.h>
| >#include <io.h>
| >#include <direct.h>
| >
| >typedef struct _finddata_t FINDDATA, *PFINDDATA;
| >
| >int main(int argc, TCHAR *argv[])
| >{
| > CStringArray rgStrPaths;
| > CStringArray rgStrPExts;
| > CString   strFileName;
| > LPTSTR   pszEnvPath = getenv("PATH"), pszVar;
| > LPTSTR   pszPathExt = getenv("PATHEXT"); // Order or precedence
| >
| > if(2 > argc)
| > {
| >  printf("usage: which filename (.COM;.EXE;.BAT;.CMD)\n\tshows which
| >executable is found in path\n");
| >  return ERROR_SUCCESS;
| > }
| >
| > if(NULL == pszEnvPath) // If getenv fails (rare if ever) - user has no 
path
| > {
| >  // I'm going to leak this, because this tool terminates soon anyway.
| >  pszEnvPath = _getcwd(NULL, sizeof(TCHAR) * MAX_PATH);
| >  if(NULL == pszEnvPath)
| >  {
| >   printf("No path\n");
| >   return ERROR_PATH_NOT_FOUND;
| >  }
| >  else
| >   rgStrPaths.Add(pszEnvPath);
| > }
| >
| > if(NULL == pszPathExt)
| > {            // Not available in environment?
| >  pszPathExt = ".COM;.EXE;.BAT;.CMD";   // Set default precedence
| >//  printf("Default precedence: %s\n", pszPathExt);
| > }
| >// else
| >//  printf("Precedence: %s\n", pszPathExt);
| >
| > // Get the CWD to search first
| > if(0 == rgStrPaths.GetSize()) // No cwd yet?
| > {
| >  strFileName.Format("%s\\", _getcwd(NULL, sizeof(TCHAR) * MAX_PATH));
| >  rgStrPaths.Add(strFileName);
| > }
| >
| > pszVar = strtok(pszEnvPath, ";");
| > while(NULL != pszVar)
| > {
| >  strFileName = pszVar;
| >
| >  if(strFileName.Right(1) != '\\')
| >   rgStrPaths.Add(strFileName + "\\");
| >  else
| >   rgStrPaths.Add(strFileName);
| >
| >  pszVar = strtok(NULL, ";");
| > }
| >
| > // Guaranteed to have one or more path variables to search, load 
precedence
| >of executable extensions
| > pszVar = strtok(pszPathExt, ";");
| > while(NULL != pszVar)
| > {
| >  rgStrPExts.Add(pszVar);
| >  pszVar = strtok(NULL, ";");
| > }
| >
| > FINDDATA fd;
| > int   i;
| >
| > for(i = 0; i < rgStrPaths.GetSize(); i++) // Paths loop
| > {
| >  // See if the user gave us an extension
| >  if(NULL != strchr(argv[1], '.'))
| >  {
| >   // Extension is user supplied:
| >   strFileName.Format("%s%s", (LPCTSTR) rgStrPaths.GetAt(i), argv[1]);
| >   if(-1 != _findfirst((LPCTSTR) strFileName, &fd))
| >   {
| >    // Found it, tell the user where and what (could have used a 
wildcard)
| >    strFileName.Format("%s%s", (LPCTSTR) rgStrPaths.GetAt(i), fd.name);
| >    printf("%s\n\n", (LPCTSTR) strFileName);
| >    return ERROR_SUCCESS;
| >   }
| >  }
| >  else
| >  {
| >   // No user extension:  look through precedence
| >   for(int x = 0; x < rgStrPExts.GetSize(); x++)
| >   {
| >    strFileName.Format("%s%s%s",
| >     (LPCTSTR) rgStrPaths.GetAt(i),
| >     argv[1],
| >     (LPCTSTR) rgStrPExts.GetAt(x) );
| >
| >    if(-1 != _findfirst((LPCTSTR) strFileName, &fd))
| >    {
| >     // Found it, tell the user where and what (could have used a 
wildcard)
| >     strFileName.Format("%s%s",
| >      (LPCTSTR) rgStrPaths.GetAt(i),
| >      fd.name );
| >
| >     printf("%s\n\n", (LPCTSTR) strFileName);
| >     return ERROR_SUCCESS;
| >    }
| >   }
| >  }
| > }
| >
| > printf("%s not found in path\n\n", argv[1]);
| > return ERROR_SUCCESS;
| >}
| >
| >
| >I've also done tail (I called it ScrollFile) if you would like to see 
that
| >too,
| >- Ed.
| Joseph M. Newcomer [MVP]
| email: newcomer@flounder.com
| Web: http://www.flounder.com
| MVP Tips: http://www.flounder.com/mvp_tips.htm

C:\ >which kernel32.dll
C:\WINDOWS\system32\kernel32.dll

C:\Program Files\MyApp >which kernel32.dll
C:\WINDOWS\system32\kernel32.dll

C:\Program Files\MyApp >ver

Microsoft Windows XP [Version 5.1.2600]

C:\ >dir kernel32.dll /s
 Volume in drive C is C
 Volume Serial Number is CC9E-DDDF

 Directory of C:\i386

08/04/2004  02:00 AM           983,552 kernel32.dll
               1 File(s)        983,552 bytes

 Directory of C:\WINDOWS\ServicePackFiles\i386

08/04/2004  12:56 AM           983,552 kernel32.dll
               1 File(s)        983,552 bytes

 Directory of C:\WINDOWS\system32

08/04/2004  04:00 AM           983,552 kernel32.dll
               1 File(s)        983,552 bytes

 Directory of C:\WINDOWS\system32\dllcache

08/04/2004  04:00 AM           983,552 kernel32.dll
               1 File(s)        983,552 bytes

     Total Files Listed:
               4 File(s)      3,934,208 bytes
               0 Dir(s)  14,344,904,704 bytes free

C:\ >

Yep, still works fine.

Note: COM/DCOM trancends search paths, so is irrelevant to which.  I 
wouldn't want to which a COM/DCOM app anyway...  which remains appropriate 
in the domain for which it is intended.  Whereis, on the other hand; perhaps 
you mean, "dir \kernel32.dll /s"?

Cheers
- Ed. 

0
Anon3258 (180)
3/8/2006 7:58:40 PM
> Yep, still works fine.

Let's see: you proved conclusively that your code works in a case where there is no reason
for it to fail.  I proved conclusively that your code fails in a case where it should
work.  What, exactly, does your test below prove?  Try it with the example I posted in my
updated essay.  Try it when you have copied kernel32.dll to the working directory!  Or to
the executable directory!

Note that the technique of putting a bogus DLL in the executable or working directory is a
way of "spoofing" API calls and therefore being able to inject Trojans into an
environment.  The reorganization of the search strategy in XP SP2 to seach the system
directories first and the current directory last, unless a certain Registry flag is set,
defeats your claim to correctness.

NT4:

exe  cwd system32 system windows PATH

XP SP2

exe system32 system windows cwd PATH

with the additional proviso that the Known DLLs cannot be overridden by the search
strategy.  Then look at the other features of LoadLibrary, such as local DLL redirection,
and make sure you can prove that all of those are simulated correctly.

I don't have to simulate.  I use the actual API, and it does whatever it is supposed to do
on the platform, given the current release, service packs, hot fixes, and Registry
settings.  The error your program contains is exactly why I had to write one that worked.
(I should point out that I wrote a program like that back in, let's see, 1968? 1969? I
wrote it for TSS/360, and later for TOPS-10.  And rewrote it in 1981 for TOPS-20, and
wrote it in C for MS-DOS in 1986, using code remarkably like yours.  So I knew the
solution you are showing could not possibly work correctly in Windows, on all platforms,
under all conditions)

Show your program running when connected to the following directories:

C:\i386
C:\WINDOWS\ServicePackFiles\i386

If your program does not return "c:\windows\system32\kernel32.dll" in both cases, then it
is incorrect.  Oh, never mind.  I already demonstrated that your program is incorrect by
doing exactly that experiment, and getting the wrong answer.  You *did* read my post and
my example, didn't you? (And no, I did not mean "dir \kernel32.dll /s".  I meant the exact
command I showed.  I showed that if kernel32.dll is in the working directory, your program
gives the wrong answer, and I demonstrated this by doing the copy, proving I did the copy,
proving that your program gives the wrong answer and mine gives the right answer, or more
specifically, your program gives an incorrect simulation of the actual behavior of
Windows)

Or is this one of those Real Unix Programmer Moments: "It doesn't matter if it's right, as
long as it's small and fast"?  Your program is wrong.  I proved your program is wrong. Why
are you continuing to claim it is right?  It doesn't do what LoadLlibrary does, and
therefore it cannot be held up as an example of a correct solution.  (What it does do is
what someone once thought they heard what LoadLibrary might once have done, possibly based
upon how they thought Unix worked.  RTFM).

"It ain't so much the things we don't know that get us in trouble. It's the things we know
that ain't so"  http://en.thinkexist.com/quotes/artemus_ward/

 				joe

On Wed, 8 Mar 2006 11:58:40 -0800, "Ed Weir \(ComCast\)" <Anon@Maus.duh> wrote:

>"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
>news:5ost02dd259h4onf5n485v3k6e7671mvjc@4ax.com...
>| Ah, but you are simulating what you THINK is happening.  In fact, that is 
>not what
>| ACTUALLY happens.  _getcwd gives the current working directory, but the 
>search strategy
>| involving the current working directory changes with various releases and 
>service packs.
>| You also don't account for the "known DLLs" feature if you are asking 
>where a DLL is
>| found.  So if you ask where "kernel32.dll" is, for example, your code 
>gives an erroneous
>| answer.  See the latest posting of my article,, where I demonstrate that 
>your code does
>| not work correctly in XP Pro SP 2.
>|
>| You may have been "using it for years" but in fact it doesn't work 
>correctly.  And that's
>| the point of my post.
>| joe
>|
>| On Tue, 7 Mar 2006 21:29:51 -0800, "Ed Weir \(ComCast\)" <Anon@Maus.duh> 
>wrote:
>|
>| >"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
>| >news:tpls02989k8k4o7lbijnn66252mgr1v965@4ax.com...
>| >| The whereis utility is often useful.  The problem in Windows is that 
>there
>| >are many
>| >| different search algorithms, based on the platform, Windows release,
>| >Service Packs
>| >| installed, etc., so any program that works like the Unix program, that 
>is,
>| >which simulates
>| >| the search path, is likely to fail, particularly in light of the 
>possible
>| >future changes
>| >| that may occur.  This program uses the LoadLibraryEx call to search the
>| >load path.
>| >|
>| >| www.flounder.com/whereis.htm
>| >|
>| >| (It took almost more time to write it up and create the zipfile than to
>| >write the program
>| >| itself...)
>| >| joe
>| >| Joseph M. Newcomer [MVP]
>| >| email: newcomer@flounder.com
>| >| Web: http://www.flounder.com
>| >| MVP Tips: http://www.flounder.com/mvp_tips.htm
>| >
>| >Thanks, but I've been using this for years, without any need for updates:
>| >#include <Afx.h>
>| >#include <io.h>
>| >#include <direct.h>
>| >
>| >typedef struct _finddata_t FINDDATA, *PFINDDATA;
>| >
>| >int main(int argc, TCHAR *argv[])
>| >{
>| > CStringArray rgStrPaths;
>| > CStringArray rgStrPExts;
>| > CString   strFileName;
>| > LPTSTR   pszEnvPath = getenv("PATH"), pszVar;
>| > LPTSTR   pszPathExt = getenv("PATHEXT"); // Order or precedence
>| >
>| > if(2 > argc)
>| > {
>| >  printf("usage: which filename (.COM;.EXE;.BAT;.CMD)\n\tshows which
>| >executable is found in path\n");
>| >  return ERROR_SUCCESS;
>| > }
>| >
>| > if(NULL == pszEnvPath) // If getenv fails (rare if ever) - user has no 
>path
>| > {
>| >  // I'm going to leak this, because this tool terminates soon anyway.
>| >  pszEnvPath = _getcwd(NULL, sizeof(TCHAR) * MAX_PATH);
>| >  if(NULL == pszEnvPath)
>| >  {
>| >   printf("No path\n");
>| >   return ERROR_PATH_NOT_FOUND;
>| >  }
>| >  else
>| >   rgStrPaths.Add(pszEnvPath);
>| > }
>| >
>| > if(NULL == pszPathExt)
>| > {            // Not available in environment?
>| >  pszPathExt = ".COM;.EXE;.BAT;.CMD";   // Set default precedence
>| >//  printf("Default precedence: %s\n", pszPathExt);
>| > }
>| >// else
>| >//  printf("Precedence: %s\n", pszPathExt);
>| >
>| > // Get the CWD to search first
>| > if(0 == rgStrPaths.GetSize()) // No cwd yet?
>| > {
>| >  strFileName.Format("%s\\", _getcwd(NULL, sizeof(TCHAR) * MAX_PATH));
>| >  rgStrPaths.Add(strFileName);
>| > }
>| >
>| > pszVar = strtok(pszEnvPath, ";");
>| > while(NULL != pszVar)
>| > {
>| >  strFileName = pszVar;
>| >
>| >  if(strFileName.Right(1) != '\\')
>| >   rgStrPaths.Add(strFileName + "\\");
>| >  else
>| >   rgStrPaths.Add(strFileName);
>| >
>| >  pszVar = strtok(NULL, ";");
>| > }
>| >
>| > // Guaranteed to have one or more path variables to search, load 
>precedence
>| >of executable extensions
>| > pszVar = strtok(pszPathExt, ";");
>| > while(NULL != pszVar)
>| > {
>| >  rgStrPExts.Add(pszVar);
>| >  pszVar = strtok(NULL, ";");
>| > }
>| >
>| > FINDDATA fd;
>| > int   i;
>| >
>| > for(i = 0; i < rgStrPaths.GetSize(); i++) // Paths loop
>| > {
>| >  // See if the user gave us an extension
>| >  if(NULL != strchr(argv[1], '.'))
>| >  {
>| >   // Extension is user supplied:
>| >   strFileName.Format("%s%s", (LPCTSTR) rgStrPaths.GetAt(i), argv[1]);
>| >   if(-1 != _findfirst((LPCTSTR) strFileName, &fd))
>| >   {
>| >    // Found it, tell the user where and what (could have used a 
>wildcard)
>| >    strFileName.Format("%s%s", (LPCTSTR) rgStrPaths.GetAt(i), fd.name);
>| >    printf("%s\n\n", (LPCTSTR) strFileName);
>| >    return ERROR_SUCCESS;
>| >   }
>| >  }
>| >  else
>| >  {
>| >   // No user extension:  look through precedence
>| >   for(int x = 0; x < rgStrPExts.GetSize(); x++)
>| >   {
>| >    strFileName.Format("%s%s%s",
>| >     (LPCTSTR) rgStrPaths.GetAt(i),
>| >     argv[1],
>| >     (LPCTSTR) rgStrPExts.GetAt(x) );
>| >
>| >    if(-1 != _findfirst((LPCTSTR) strFileName, &fd))
>| >    {
>| >     // Found it, tell the user where and what (could have used a 
>wildcard)
>| >     strFileName.Format("%s%s",
>| >      (LPCTSTR) rgStrPaths.GetAt(i),
>| >      fd.name );
>| >
>| >     printf("%s\n\n", (LPCTSTR) strFileName);
>| >     return ERROR_SUCCESS;
>| >    }
>| >   }
>| >  }
>| > }
>| >
>| > printf("%s not found in path\n\n", argv[1]);
>| > return ERROR_SUCCESS;
>| >}
>| >
>| >
>| >I've also done tail (I called it ScrollFile) if you would like to see 
>that
>| >too,
>| >- Ed.
>| Joseph M. Newcomer [MVP]
>| email: newcomer@flounder.com
>| Web: http://www.flounder.com
>| MVP Tips: http://www.flounder.com/mvp_tips.htm
>
>C:\ >which kernel32.dll
>C:\WINDOWS\system32\kernel32.dll
>
>C:\Program Files\MyApp >which kernel32.dll
>C:\WINDOWS\system32\kernel32.dll
>
>C:\Program Files\MyApp >ver
>
>Microsoft Windows XP [Version 5.1.2600]
>
>C:\ >dir kernel32.dll /s
> Volume in drive C is C
> Volume Serial Number is CC9E-DDDF
>
> Directory of C:\i386
>
>08/04/2004  02:00 AM           983,552 kernel32.dll
>               1 File(s)        983,552 bytes
>
> Directory of C:\WINDOWS\ServicePackFiles\i386
>
>08/04/2004  12:56 AM           983,552 kernel32.dll
>               1 File(s)        983,552 bytes
>
> Directory of C:\WINDOWS\system32
>
>08/04/2004  04:00 AM           983,552 kernel32.dll
>               1 File(s)        983,552 bytes
>
> Directory of C:\WINDOWS\system32\dllcache
>
>08/04/2004  04:00 AM           983,552 kernel32.dll
>               1 File(s)        983,552 bytes
>
>     Total Files Listed:
>               4 File(s)      3,934,208 bytes
>               0 Dir(s)  14,344,904,704 bytes free
>
>C:\ >
>
>Yep, still works fine.
>
>Note: COM/DCOM trancends search paths, so is irrelevant to which.  I 
>wouldn't want to which a COM/DCOM app anyway...  which remains appropriate 
>in the domain for which it is intended.  Whereis, on the other hand; perhaps 
>you mean, "dir \kernel32.dll /s"?
>
>Cheers
>- Ed. 
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
3/8/2006 9:06:16 PM
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
news:jkfu02581ptb21hrbjbqkkpf9sho19770e@4ax.com...
|> Yep, still works fine.
|
| Let's see: you proved conclusively that your code works in a case where 
there is no reason
| for it to fail.  I proved conclusively that your code fails in a case 
where it should
| work.  What, exactly, does your test below prove?  Try it with the example 
I posted in my
| updated essay.  Try it when you have copied kernel32.dll to the working 
directory!  Or to
| the executable directory!
|
| Note that the technique of putting a bogus DLL in the executable or 
working directory is a
| way of "spoofing" API calls and therefore being able to inject Trojans 
into an
| environment.  The reorganization of the search strategy in XP SP2 to seach 
the system
| directories first and the current directory last, unless a certain 
Registry flag is set,
| defeats your claim to correctness.
|
| NT4:
|
| exe  cwd system32 system windows PATH
|
| XP SP2
|
| exe system32 system windows cwd PATH
|
| with the additional proviso that the Known DLLs cannot be overridden by 
the search
| strategy.  Then look at the other features of LoadLibrary, such as local 
DLL redirection,
| and make sure you can prove that all of those are simulated correctly.
|
| I don't have to simulate.  I use the actual API, and it does whatever it 
is supposed to do
| on the platform, given the current release, service packs, hot fixes, and 
Registry
| settings.  The error your program contains is exactly why I had to write 
one that worked.
| (I should point out that I wrote a program like that back in, let's see, 
1968? 1969? I
| wrote it for TSS/360, and later for TOPS-10.  And rewrote it in 1981 for 
TOPS-20, and
| wrote it in C for MS-DOS in 1986, using code remarkably like yours.  So I 
knew the
| solution you are showing could not possibly work correctly in Windows, on 
all platforms,
| under all conditions)
|
| Show your program running when connected to the following directories:
|
| C:\i386
| C:\WINDOWS\ServicePackFiles\i386
|
| If your program does not return "c:\windows\system32\kernel32.dll" in both 
cases, then it
| is incorrect.  Oh, never mind.  I already demonstrated that your program 
is incorrect by
| doing exactly that experiment, and getting the wrong answer.  You *did* 
read my post and
| my example, didn't you? (And no, I did not mean "dir \kernel32.dll /s".  I 
meant the exact
| command I showed.  I showed that if kernel32.dll is in the working 
directory, your program
| gives the wrong answer, and I demonstrated this by doing the copy, proving 
I did the copy,
| proving that your program gives the wrong answer and mine gives the right 
answer, or more
| specifically, your program gives an incorrect simulation of the actual 
behavior of
| Windows)
|
| Or is this one of those Real Unix Programmer Moments: "It doesn't matter 
if it's right, as
| long as it's small and fast"?  Your program is wrong.  I proved your 
program is wrong. Why
| are you continuing to claim it is right?  It doesn't do what LoadLlibrary 
does, and
| therefore it cannot be held up as an example of a correct solution.  (What 
it does do is
| what someone once thought they heard what LoadLibrary might once have 
done, possibly based
| upon how they thought Unix worked.  RTFM).
|
| "It ain't so much the things we don't know that get us in trouble. It's 
the things we know
| that ain't so"  http://en.thinkexist.com/quotes/artemus_ward/
|
|  joe
|
| On Wed, 8 Mar 2006 11:58:40 -0800, "Ed Weir \(ComCast\)" <Anon@Maus.duh> 
wrote:
|
{snip}

OK, I'll concede your point regarding search order precedence;  Armed with 
this new info I could spend about 15 minutes updating which if I ever feel 
it's important enough to do that.

Thanks for the information,
- Ed. 

0
Anon3258 (180)
3/8/2006 10:21:28 PM
Let's see: 15 minutes?  You have to understand the various search path protocols, in each
version of Windows from NT4/Win9x, Win2K, Win2K SP1, Win2K SP2, XP, XP SP1, XP SP2, Server
2003, possible changes under those Service Packs, and Vista.  Your program has to detect
the OS and decide which search algorithm applies.  Or, you can use a single line,
LoadLibraryEx, that does ALL this, in a platform-specific fashion, and it gets it right.
So if you want to spend 15 minutes, rip out the faulty simulation and replace it with an
accurate method implemented in the API itself.
					joe

On Wed, 8 Mar 2006 14:21:28 -0800, "Ed Weir \(ComCast\)" <Anon@Maus.duh> wrote:

>"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
>news:jkfu02581ptb21hrbjbqkkpf9sho19770e@4ax.com...
>|> Yep, still works fine.
>|
>| Let's see: you proved conclusively that your code works in a case where 
>there is no reason
>| for it to fail.  I proved conclusively that your code fails in a case 
>where it should
>| work.  What, exactly, does your test below prove?  Try it with the example 
>I posted in my
>| updated essay.  Try it when you have copied kernel32.dll to the working 
>directory!  Or to
>| the executable directory!
>|
>| Note that the technique of putting a bogus DLL in the executable or 
>working directory is a
>| way of "spoofing" API calls and therefore being able to inject Trojans 
>into an
>| environment.  The reorganization of the search strategy in XP SP2 to seach 
>the system
>| directories first and the current directory last, unless a certain 
>Registry flag is set,
>| defeats your claim to correctness.
>|
>| NT4:
>|
>| exe  cwd system32 system windows PATH
>|
>| XP SP2
>|
>| exe system32 system windows cwd PATH
>|
>| with the additional proviso that the Known DLLs cannot be overridden by 
>the search
>| strategy.  Then look at the other features of LoadLibrary, such as local 
>DLL redirection,
>| and make sure you can prove that all of those are simulated correctly.
>|
>| I don't have to simulate.  I use the actual API, and it does whatever it 
>is supposed to do
>| on the platform, given the current release, service packs, hot fixes, and 
>Registry
>| settings.  The error your program contains is exactly why I had to write 
>one that worked.
>| (I should point out that I wrote a program like that back in, let's see, 
>1968? 1969? I
>| wrote it for TSS/360, and later for TOPS-10.  And rewrote it in 1981 for 
>TOPS-20, and
>| wrote it in C for MS-DOS in 1986, using code remarkably like yours.  So I 
>knew the
>| solution you are showing could not possibly work correctly in Windows, on 
>all platforms,
>| under all conditions)
>|
>| Show your program running when connected to the following directories:
>|
>| C:\i386
>| C:\WINDOWS\ServicePackFiles\i386
>|
>| If your program does not return "c:\windows\system32\kernel32.dll" in both 
>cases, then it
>| is incorrect.  Oh, never mind.  I already demonstrated that your program 
>is incorrect by
>| doing exactly that experiment, and getting the wrong answer.  You *did* 
>read my post and
>| my example, didn't you? (And no, I did not mean "dir \kernel32.dll /s".  I 
>meant the exact
>| command I showed.  I showed that if kernel32.dll is in the working 
>directory, your program
>| gives the wrong answer, and I demonstrated this by doing the copy, proving 
>I did the copy,
>| proving that your program gives the wrong answer and mine gives the right 
>answer, or more
>| specifically, your program gives an incorrect simulation of the actual 
>behavior of
>| Windows)
>|
>| Or is this one of those Real Unix Programmer Moments: "It doesn't matter 
>if it's right, as
>| long as it's small and fast"?  Your program is wrong.  I proved your 
>program is wrong. Why
>| are you continuing to claim it is right?  It doesn't do what LoadLlibrary 
>does, and
>| therefore it cannot be held up as an example of a correct solution.  (What 
>it does do is
>| what someone once thought they heard what LoadLibrary might once have 
>done, possibly based
>| upon how they thought Unix worked.  RTFM).
>|
>| "It ain't so much the things we don't know that get us in trouble. It's 
>the things we know
>| that ain't so"  http://en.thinkexist.com/quotes/artemus_ward/
>|
>|  joe
>|
>| On Wed, 8 Mar 2006 11:58:40 -0800, "Ed Weir \(ComCast\)" <Anon@Maus.duh> 
>wrote:
>|
>{snip}
>
>OK, I'll concede your point regarding search order precedence;  Armed with 
>this new info I could spend about 15 minutes updating which if I ever feel 
>it's important enough to do that.
>
>Thanks for the information,
>- Ed. 
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
3/9/2006 7:39:27 AM
As I was running errands this afternoon, I was thinking about other aspects of whereis (as
derived from my work on my LoadLibrary Explorer, which may be the next essay I write...the
code is working, and I'm adding the little fiddly bits to make it really cool...)

So I added a feature where it can check up on the App Paths key in the Registry, which is
used to map executable names to full paths when ShellExecute(Ex) calls launch an app.  I
tested it out using a little ShellExecute/CreateProcess utility.

The revisions to the essay and the revised code are now on my Web site.
					joe

On Tue, 07 Mar 2006 23:05:40 -0500, Joseph M. Newcomer <newcomer@flounder.com> wrote:

>The whereis utility is often useful.  The problem in Windows is that there are many
>different search algorithms, based on the platform, Windows release, Service Packs
>installed, etc., so any program that works like the Unix program, that is, which simulates
>the search path, is likely to fail, particularly in light of the possible future changes
>that may occur.  This program uses the LoadLibraryEx call to search the load path.
>
>www.flounder.com/whereis.htm
>
>(It took almost more time to write it up and create the zipfile than to write the program
>itself...)
>				joe
>Joseph M. Newcomer [MVP]
>email: newcomer@flounder.com
>Web: http://www.flounder.com
>MVP Tips: http://www.flounder.com/mvp_tips.htm
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
3/9/2006 7:43:09 AM
Reply:

Similar Artilces:

Must buy new computer...Ideas?
Hello to all! Finally my over 10-1/2 year old Dell desktop's extreme slowness has seriously gotten on my nerves and I'm now looking for a new one. (Surprisingly, it's working pretty well otherwise...) Maybe this isn't the right forum? But beside the usual things like RAM and HD GBs, are there things I should be sure to have...or be careful NOT to have on a desktop? After n ot looking into computers for over a decade I feel like a Martian in the Earth. lol! Also, is it possible to transfer to the new one ALL my stuff, including programs, etc.? Do you thin...

Default properties for new folders
How does one set the default properties applied when creating new email folders? Currently, when I create a new folder, it is created with the AutoPreview turned on by default. I'd like to change that do that it is left off by default. It's something of a pain to create a new folder and then go in to customize it's properties. You can do this by editing the Messages view; View-> Arrange By-> Current View-> Define Views... You might want to define a new view yourself and apply that view on first use of that folder. -- Robert Sparnaaij [MVP-Outlook] www.howto-o...

New Email Messages
I just installed Outlook 2007 on my new PC and for some reason the new messages I received can only be received when I press the SEND/RECEIVE BUTTON. My Outlook at work receives these new mail messages as they are received. So how can I configure the system to make that happen? -- The Trail Hiker!! There are two settings within the accounts 1) Send on starting 2) Auto send/receive every xx minutes - set this for 10 minutes "hiker0531" <hiker0531@aol.com> wrote in message news:87259C7A-5C07-4846-BF61-DE3F98345D21@microsoft.com... >I just installed Outlook 2007 on my n...

Prevent new comments on old posts in sharepoint blogs
How do I stop comments on certain posts in a SharePoint blog? I have removed permissions to the specific post to the lowest possible access and people can STILL post a comment. If I uncheck one more item in the list of permissions, the users can no longer see the post. Any suggestions? ...

Unable to open "New" window to write email.
I am using Microsoft Outlook in Office 2003. It has been working great until today. When I click "New" to write a new email I get an error window : The messaging interface has returned an unknown error. If the problem persist, Restart Outlook. I have tried this several times, even restarted the computer to no avail. Anyone have a solution???? ...

New Location/New setup
Currently I'm downsizing our office, and moving to a new location. I'm running MS Server2003 as well as Exchange 2003. Once moved, I will no longer require the server (since I am setting up a home office). Are there currently any steps or procedures available to correctly shutdown one office...and basically setup a home office with no exchange server. Also I will be removing the current pc's from the Domain, and setting up a few in a workgroup. I would like to receive emails from the other employees for time being until I completely cancel this email account. I already have a...

A Short Video on Adding/Editing New Customers
If capturing customers at the POS is important to you, take a couple of minutes and watch this video. This application also allows for edit of Global customer information in HQ installations. http://www.retail-pos.com/ReverseLookup.wmv Contact us for detailed info and demo. sales(at)retail-pos.com www.retail-pos.com It would be nice if you could encode the videos with a more common codec, and not in wmv format. This requires the GTM3 codec (GoToMeeting). Windows Media Player 11 doesn't automatically download the codec, and I'm not going through the trouble to download and in...

How do I activate the new mail button
When I start Outlook, the "New", "forward", "reply" and "reply to all" buttons are not active which means I can not send mail. I have no problems receiving mail. Also, on web pages with email links, when I click on them, the Outlook application is not launched which is almost certainly related to this. I think I'm missing something very simple here! Are you in a mail enabled folder? Do you have an active email account installed? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert...

Style available all sheets new or old
I need a custom style that is available in all spreadsheets, new or old. I can set style and save it in book.xlt in xlstart, but that only works for new workbooks, and doesn't work with old spreadsheets when I call them up. I want to be able to select a group of cells, or column or row and apply a setting for negative numbers to have brackets. I am using Excel 2000. I even tried saving the style in personal.xls, but that doesn't work as it is hidden. Do I have to use a macro? And if so what would it be? Thanks One way: Public Sub MergeStyles() ActiveWorkbook....

Sub Form Assigning New Values to Old Records
I am using a subform within a form to have users update certain fields in the record where the rest remiain locked. On the Main form when the list box (which is bound to a query) is used to select the record set to display in the subform it sometimes takes an old record and assigns a new value to the record. For example it changes the Period field from 9 to 10. Taking a record created in period 9 and assigning a period ten to it which is the selection I make in the list box. Addtionally, it looks like it is taking the first record in the related table to assign this new value to. ...

Adding new pages
Any thing I do on new pages happens simultaneously on any previous page. Can someone help me please? Can you be more specific? What stencils are you using and what are you trying? John... Visio MVP Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm Need VBA examples? http://www.mvps.org/visio/VBA.htm Common Visio Questions http://www.mvps.org/visio/common_questions.htm "Joanie" <anonymous@discussions.microsoft.com> wrote in message news:4C3642E4-4F2B-4A65-8C00-E9041CE74A37@microsoft.com... > Any thing I do on new pages happens simultaneously on any previ...

Which table will refresh by adding new Account / Contact
Hi, I am new to CRM and trying to update CRM Accounts and Contacts from our Sales Management system. I am using Micorosft Bulk Import utility. I am in preparation of CVS files but not sure what columns do I need in CVS file to complete one Account/Contact record. Could anybody please help. I am .NET expert developer, please let me guide If I could develop CRM by using .NET not CVS Regards Hi Adnan, Microsoft do provide CRM SDK for CRM enhancment using .net. You can download from following url http://www.microsoft.com/downloads/details.aspx?familyid=9C178B68-3A06-4898-BC83-BD14B74308C5...

New messages comes up in Deleted folder
Sometimes when I receive new messages the go to the Deleted folder instead of the Inbox. The messages are from random people...not just one sender. What is the problem? Thanks Check your message rules/filters. "key word" in new mail subject line of body is probably being tagged and filtered to deleted items folder. Regards C. >-----Original Message----- >Sometimes when I receive new messages the go to the >Deleted folder instead of the Inbox. The messages are >from random people...not just one sender. What is the >problem? Thanks >. > ...

New User has admin rights
I just created a new user and assigned her the role of Sales Manager. This role is working correctly for other users with it assigned, but she has admin rights? This is the only role she has assigned.... Any ideas? TIA Metcalf ...

New trend, new business, new year a new beginning
New trend, at start of new year. "If you want things to work different, you must try a different...whatever..." Does that seem obvious? Brighten up with this "reading" and attack the money issue with more gusto! I am finishing my year 2005 with some regrets and some joy. For some the year passed has not been "tip top" in their view. But I believe it has just been very well as the page I shall bring you that has this statement which I believe wholeheartedly: "THINGS ARE UNFOLDING AS IT SHOULD" (paraphrased) I invite you to read the whole "poem&quo...

Creating new row in other table
Dear All, Please teach me, how to make a new row/list in other table by entering number in other table. Sample, In the table A and in the field "Details", I put the number 2 and it automatically creates two rows in table B. Can this be done in MS Access? Thank you for your help. Regards, Maulwy Why? What business need are you attempting to solve with this approach? It's generally considered not very good database design to be creating 'empty' rows in a second table. Why do you want empty rows? And if the number you enter in TableA is a 'limit&...

AP
What would be the best tool to add a new field in the AP invoice screen to deploy to a client? Extender? Modifier? the ideal would be to add a field for "Job No." that is text info so the user can get some info out on certain jobs that they are paying bills for. thanks -- Linda W. Linda, You can use any tool, really, to accomplish this: - Modifier with VBA. You can add the fields to the window with Modifier, then use VBA and ADO or DUOS to store and retrieve the data. - Modifier with Dexterity. You can add the fields with Modifier, then trigger off the form with Dex...

Button "New Account" in Sub-Accountsview opens Parent account
When I open an account, and then go to the subaccounts of that account, I click on the Button "New Account" to create a new subaccount for this account. Instead of opening a new account form, the application opens the original Account form. Anybody an idea how this is possible? Regards, Sanne groenhof -- MSCRM, hosted as ASP, and configured for your business. Sanne, Have you installed any specific toolbars in your Internet Explorer? Like google toolbar/msn toolbar? -- Rob Bakkers, Avanade Netherlands "Sanne" wrote: > When I open an account, and then go to...

new to old
hi, A web designing company has just done us a website, and part of it includes the database of our stock. They have written/created it on access xp, but we have only got and old version of access. Can we open/use/update files written in access xp on an older version of access? thanks very much jethro Hi Jethro, It depends. By default Access 2002 (XP) uses the Access 2000 file format, so if you have Access 2000 you may be able to use the database as is. However, if the database is in the form of an mde file created by Access 2002 it will be in Access 2002 format. Otherwise (i.e. if t...

New Accounts on Exchange 2003
This week I entered two new people and the reciepent policy is not providing the necessary email addresses. Of course without those, the GAL does not get updated and no one can email them. I have Exchange 2003 running on Server 2003 with a w2k AD. Any suggestions for jump starting the default reciepent policy? Omer, Thanks for the response. The Recipient Update Service was scheduled for once an hour. I changed it to every 15 minutes. I also tried the "Update Now" feature. For both of these, there were no events generated. I remember setting up trace logs earlier this y...

new columns created from "&nbsp;"
I have a bunch of data in a column and it is "separated" by "&nbsp;". The data was imported from an online database. Is there a way to create columns within the current workbook from where the &nbsp; appears? (much like importing a text file) TIA, Greg Greg Wilker wrote: > I have a bunch of data in a column and it is "separated" by "&nbsp;". > > The data was imported from an online database. > > Is there a way to create columns within the current workbook from where the > &nbsp; appears? (much like importing a te...

create new folder is always greyed out-why?
"Create new folder" is always greyed out-why? ...

No new fonts allowed
I have an excel workbook that contains graphs, downloads and linked data and I consistantly get an error when updating the spreadsheet and graphs - "No more new Fonts may be applied to this workbook". What is this error telling me? What can and can I not do? Has anyone else experienced this? Jon Peltier has some information on this in his Charting FAQ article: http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=209#jon025 david wrote: > I have an excel workbook that contains graphs, downloads > and linked data and I consistantly get an error when > updat...

My synchronized emails disappeared after adding a new account
This is a multi-part message in MIME format. ------=_NextPart_000_004F_01CB5135.56C7EAD0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I created first an account and I synchronized everything on my local = machine, meaning all messages not only the headers. After doing this I checked if those messages were in my local computer = and they were all there. I added a new live account and I did not even synchronized it. Just = logged in it. To my surprise when I clicked on the first account which was a Hotmail = one, I...

Importing objects in new db fails partly
I have the following peculiar problem. When I import my database objects into a new database there are some forms which are not imported complete. The import completes without errors. Those 'problem' forms are visible in the database window, and the VBA code is also present. Only the actual form object is missing. It is not possible to open the form, even not in the design mode. When I import those forms again there are no problems and the forms can be opened without problem. Exporting the forms from the source database (with an add-in / VBA code) causes no problem. I use Acces...