Showing results for 
Search instead for 
Did you mean: 

Get Windows User Connection Status for Local AND Remote Users

Go to solution
Accepted by StevoP80

You try to execute the program query.exe which is located in the system directory, in most cases it is c:\windows\system32. You are using 32 bit application and that causes a redirection to c:\windows\SysWOW64. In this folder, there is no query.exe application. You can either temporarily disable the redirection by calling Wow64DisableWow64FsRedirection and Wow64RevertWow64FsRedirection  functions. Be careful with these functions. They affect all file operations of the current thread. 

The other way is to point directly to the system32 folder with %windir%\Sysnative.


In your case, the command "cmd /c %windir%\Sysnative\query user" should work in both 32bit and 64bit.

Message 11 of 12



This worked!! Thanks so much for this, and for the detailed explanation for what was going on. I will make sure to remember this if I use System Exec vi in the future.

0 Kudos
Message 12 of 12