Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7559813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:43:54+00:00 2026-05-30T12:43:54+00:00

If I call REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI in a batch script then the correct result

  • 0

If I call

REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI

in a batch script then the correct result is displayed:

ShowTabletKeyboard    REG_DWORD 0x0
LastLoggedOnProvider  REG_SZ    {???}
LastLoggedOnSAMUser   REG_SZ    foo\bar
LastLoggedOnUser      REG_SZ    .\bar

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonU \Background
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\BootAnimation
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\LogonSoundPlayed
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\SessionData

If I run the command above from within a c program (mingw):

#include <stdio.h>
#include <unistd.h>
int main(void) {
    system("REG QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Authentication\\LogonUI");
    return (0);
}

the output is

ShowTabletKeyboard    REG_DWORD    0x0

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\BootAnimation

Where is the rest of the output? Which permissions are wrong? I am interested in the key LastLoggedOnUser. Many thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T12:43:55+00:00Added an answer on May 30, 2026 at 12:43 pm

    This is the action of the registry redirector. You have a 64 bit system. The batch file is executed by the native 64 bit command interpreter. But your C program is 32 bit, and the system command runs as a 32 bit process. That happens because of the file redirector which translates system32 to syswow64 when you run a 32 bit process on 64 bit Windows.

    All this means that the C program is reading out of the 32 bit view of the registry. Your attempt to read HKLM\Software is redirected to HKLM\Software\Wow6432Node.

    The ideal solution would be to stop using system and use the native Windows API functions to access the registry. Then you could specify that you want to read from the 64 bit view of the registry and you could gain access to that even from a 32 bit process.

    An utterly revolting hack would be to get your system command to start %SystemRoot%\Sysnative\reg.exe which would force the use of the 64 bit version of reg.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Call me a 'n00b', but I am new to creating Script Controls. I want
I call an ajax enabled wcf service method , <script type=text/javascript> function GetEmployee() {
I have several .reg (Windows registry) files (generated by an external application) that need
I've got very unexpected result from Pin Tool, my tool looks for CALL/RET instructions
I'm trying to query a particular registry folder (or whatever you want to call
I am trying to understand a Windows batch file with the following statements: :GetVSCommonToolsDirHelper32
I call my JavaScript function. Why do I sometimes get the error 'myFunction is
I call a javascript function from a textbox by using OnKeyPress=clickSearchButton() Here is my
I call the following function with a mouseover event but it's not working. My
I call this a flash meeting, but maybe there is another more appropriate name.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.