none
Batch Script Question - REG QUERY results

    Question

  • I have finally figured out why my script is not doing what I thought it should do, but do not understand how to fix it.  

    I have a Windows 7 64 bit PC.  get different results when I run this command:  and run this REG QUERY command: 

    REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

    When I run the command from C:\Windows\SysWOW64\cmd.exe, the results I actually see are from HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

    When I run the command from C:\Windows\system32\cmd.exe, the results I see are from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall as expected.

    The actual problem is that I am testing the script and running it from my PC thinking everything works because when I open up cmd.exe, it opens the one in system32.  When the script is run by SCCM, it seems to use the cmd.exe in SysWOW64.  

    I have read a couple things online, but they did not make sense to me and was hoping someone could expalin to me why I get basically false results when running the reg query on the sysWOW64 cmd.exe

    Thanks.  

    Matt


    Matt Dillon

    Tuesday, October 15, 2013 7:42 PM

Answers