I have no idea if this relates to any more executables aside from this one, but it has got me flustered. I am attempting to query the session ids and states on a remote pc via "paexec \\RemotePC query session". This works fine with psexec. When I attempt with paexec, I get the following:
I thought maybe it was a path problem, so I tried specifying the full path "c:\windows\system32\query.exe", using -w "c:\windows\system32\", and both. I wrote a batch script that called the executable with the same results (the batch file did run however). At a loss, I tried running it interactively on all known sessions on the remote machine (-i X), specifying different users from admins to guest and still no go. I triple checked that the executable was there. Any advice would be appreciated asked 18 Oct '13, 01:33 mindchild |
Hi Mindchild i confirm %windir%sysnativequers works with paexec Great troubleshooting answered 17 May '17, 09:40 AlwaysOnandOn |
Ok, some more information. I tried quser.exe with the same result. I thought I'd check in dependency walker (depends.exe) to see if there was something unusual about these executables, because cscript.exe works. I drag-and-dropped query.exe to the dependency walker window and lo' and behold, it said '"c:\windows\system32\query.exe" not found'. So I tried file->open and it isn't listed at all in file open browser (same with quser.exe). I tried renaming (copying and renaming) query.exe to querytest.exe and leaving it in c:\windows\system32\ and still can't be found.
Continued:
I copied query.exe to a temp folder (c:\temp\query.exe) and tried and THAT worked. So SOMETHING about these files INSIDE c:\windows\system32\ is special. Something that psexec can handle, but paexec (and apparently dependency walker) can not
Ok, another update. Apparently, a 32bit application trying to access c:\windows\system32\ on a 64bit system will redirect to c:\windows\syswow64\. Most of the applications in system32 have a counterpart in syswow64, which made this tedious to figure out. moving query.exe and quser.exe to syswow64 worked and confirmed this finding. So, I think the solution here is to disable file system redirection or replace %windir%\system32 with %windir%\sysnative
Hope this helps.