CA Client Automation

 View Only
  • 1.  SetMode64 on Dos batch

    Posted May 06, 2013 10:08 AM
    I use a Dos script which read registry data in an asset job
    On 64 machines the path is redirected to Wow6432Node. This works as described in TEC543381
    As described, for DSM script there is a command to disable the redirection.

    Is there a similar option for Dos?


  • 2.  RE: SetMode64 on Dos batch

    Posted May 06, 2013 01:30 PM
    It may work properly if you access %windir%\Sysnative instead of %windir%\System32 to get at the 64-bit versions of apps you need to launch.


  • 3.  RE: SetMode64 on Dos batch

    Posted May 07, 2013 02:17 AM
    I use reg.exe

    If, with my user, I use "C:\Windows\SysWOW64\reg.exe" I get the data from "HKLM\SOFTWARE\Wow6432Node".
    If I use "C:\Windows\System32\reg.exe" I get the data from "HKLM\SOFTWARE".

    But when the asset job runs, I get in both cases HKLM\SOFTWARE\Wow6432Node...

    I then tried following:
    In the script I added
    [font=Times New Roman]dir C:\Windows\SysWOW64\reg.exe
    dir C:\Windows\System32\reg.exe[font]
    and routed both to a text file.

    Result:
    >
    Directory of C:\Windows\SysWOW64

    14.07.2009 03:14 62.464 reg.exe
    1 File(s) 62.464 bytes
    0 Dir(s) 23.915.536.384 bytes free

    ---------------

    Directory of C:\Windows\System32

    14.07.2009 03:14 62.464 reg.exe
    1 File(s) 62.464 bytes
    0 Dir(s) 23.915.536.384 bytes free

    Both show the same executable, even if the directory is different!

    If I try manually:
    >
    Directory of C:\Windows\SysWOW64

    14.07.2009 03:14 62.464 reg.exe
    1 File(s) 62.464 bytes
    0 Dir(s) 23.914.278.912 bytes free

    ----------------

    Directory of C:\Windows\System32

    14.07.2009 03:39 74.752 reg.exe
    1 File(s) 74.752 bytes
    0 Dir(s) 23.914.278.912 bytes free


    I get a proper result.
    I don't quite understand it...


  • 4.  Re: [Client Management Solutions General Discussion] RE: SetMode64 on Dos b
    Best Answer

    Posted May 07, 2013 03:01 AM
    I may have missed the thread, but what is it you are trying to do?

    I will add more detail, joe and I have had long conversations about crazy
    operating system setups.

    I write crazy batch files all the time. For instance, i have a single
    package to install java, (32bit and 64bit) uninstall all versions detected
    and set the product up per security requirements.

    I have 5 lines of code that will always know where you are. Hear me out
    first though

    For instance you have several different things to know about 64bit machines
    and command prompts.

    First c:\windows\system32 is 64 bit binaries
    Second c:\windows\syswow64 is 32 bit binaries
    Third the reg hive hklm/software is a 64 registry hive
    Fourth the reg hive hklm\software\wow6432node is a 32 bit hive.
    Fun fact: all user profiles on a 64 bit machine are actually pure 32bit...
    ( reg hives included.)

    Now next is to know how to query properly to each location.

    Now lets say you are a 64bit machine running 64bit command prompt,
    (c:\windows\system32\cmd.exe) and you want to run a reg query for a 64bit
    key then you would use
    reg query hklm\software
    ,but if you want to reg query a 32 bit key you would use
    reg.exe hklm\software\wow6432node
    Or
    % windir%\syswow64\reg.exe hklm\software

    Now here is where it gets tricky. You are running a 64 bit machine but
    running a 32bit command prompt... (ahem, the ca client is a 32 bit
    application so every script runs as this by default. From within ca of
    course.) (C:\windows\syswow64\cmd.exe)
    Now lets say you want to query for a 64 bit registry key. You now have a
    problem you have to access the 64 bit system, which can not be done by the
    standard command. To do this you have to run the following:
    % windir%\sysnative\reg.exe hklm\software

    Now lets say you only want to query for a 32bit registry key. That is
    simple just run:
    Reg query hklm\software
    Or more complicated by running the following
    % windir%\sysnative\reg.exe query hklm\software\wow6432node

    Please excuse any misspellings, this was sent from my phone.

    If you need more help please let me know.

    --

    ------------------------------
    The information contained in this e-mail and any attached documents may be
    privileged, confidential and protected from disclosure. If you are not the
    intended recipient you may not read, copy, distribute or use this
    information. If you have received this communication in error, please
    notify the sender immediately by replying to this message and then delete
    it from your system.
    ----------------------------


  • 5.  RE: Re: [Client Management Solutions General Discussion] RE: SetMode64 on D

    Posted May 07, 2013 04:03 AM
      |   view attached
    Thank you for your help!

    I was first confused about "sysnative" as I did not see it as directory.
    Now my script works on both 32 and 64 bit machines.

    The script collects data and statistics from the UPM rollup packages and creates an inventory .mif file for that.