For some reason Everything is not indexing all files. I'm on latest but I've had this problems since I started running everything unelevated:
RUNAS /trustlevel:0x20000 "Everything64.exe -startup"
Which also is run by an UnElevate utility. The entire point of running it unelevated is because if I run pdf's with elevacted everything the pdf viewer(sumatrapdf) becomes elevated then I can't load pdfs in it... or if sumatrapdf gets run unelevated then everything can load pdfs in it.
I believe that everything is likely not indexing because it is unelevated as it says, at least initially, that it requires admin or the service. The service is installed though so I don't know why it is not working.
For example, now I get "Access denied: Install the Everything service or run as administrator to index this volume" on all the NTFS drives. I did not see this before I upgraded(I was on 1394 I think). Again, the service is installed(although I do not technically know if the installer updated it or not and if that matters). Of course I do not get that error when I run it as administrator.
The unelevate code, not originally mine, is given below. It might be possible for you to use this to run verbs or apps unelevated so there is no issue with elevation. Either way, the real issue seems to be why the latest everything version is not using the service(not sure if it simply did not uninstall the previous service so is using an incompatible version).
I did uncheck the "Everything service" in the options and it seems to uninstall the service... I then checked it again and it installed it.
Code: Select all
#define STRICT
#define UNICODE
#define _UNICODE
#include <windows.h>
#include <shldisp.h>
#include <shlobj.h>
#include <exdisp.h>
#include <atlbase.h>
#include <stdlib.h>
#include <shlwapi.h>
#include <atlalloc.h>
#include <stdio.h>
class CCoInitialize {
public:
CCoInitialize() : m_hr(CoInitialize(NULL)) {}
~CCoInitialize() { if (SUCCEEDED(m_hr)) CoUninitialize(); }
operator HRESULT() const { return m_hr; }
HRESULT m_hr;
};
// FindDesktopFolderView incorporated by reference
void FindDesktopFolderView(REFIID riid, void** ppv)
{
CComPtr<IShellWindows> spShellWindows;
spShellWindows.CoCreateInstance(CLSID_ShellWindows);
CComVariant vtLoc(CSIDL_DESKTOP);
CComVariant vtEmpty;
long lhwnd;
CComPtr<IDispatch> spdisp;
spShellWindows->FindWindowSW(
&vtLoc, &vtEmpty,
SWC_DESKTOP, &lhwnd, SWFO_NEEDDISPATCH, &spdisp);
CComPtr<IShellBrowser> spBrowser;
CComQIPtr<IServiceProvider>(spdisp)->
QueryService(SID_STopLevelBrowser,
IID_PPV_ARGS(&spBrowser));
CComPtr<IShellView> spView;
spBrowser->QueryActiveShellView(&spView);
spView->QueryInterface(riid, ppv);
}
void GetDesktopAutomationObject(REFIID riid, void** ppv)
{
CComPtr<IShellView> spsv;
FindDesktopFolderView(IID_PPV_ARGS(&spsv));
CComPtr<IDispatch> spdispView;
spsv->GetItemObject(SVGIO_BACKGROUND, IID_PPV_ARGS(&spdispView));
spdispView->QueryInterface(riid, ppv);
}
void ShellExecuteFromExplorer(
PCWSTR pszFile,
PCWSTR pszParameters = nullptr,
PCWSTR pszDirectory = nullptr,
PCWSTR pszOperation = nullptr,
int nShowCmd = SW_SHOWNORMAL)
{
CComPtr<IShellFolderViewDual> spFolderView;
GetDesktopAutomationObject(IID_PPV_ARGS(&spFolderView));
CComPtr<IDispatch> spdispShell;
spFolderView->get_Application(&spdispShell);
CComQIPtr<IShellDispatch2>(spdispShell)
->ShellExecute(CComBSTR(pszFile),
CComVariant(pszParameters ? pszParameters : L""),
CComVariant(pszDirectory ? pszDirectory : L""),
CComVariant(pszOperation ? pszOperation : L""),
CComVariant(nShowCmd));
}
int __cdecl wmain(int argc, wchar_t** argv)
{
if (argc < 2) return 0;
CCoInitialize init;
ShellExecuteFromExplorer(
argv[1],
argc >= 3 ? argv[2] : L"",
argc >= 4 ? argv[3] : L"",
argc >= 5 ? argv[4] : L"",
argc >= 6 ? _wtoi(argv[5]) : SW_SHOWNORMAL);
return 0;
}