Announcement

Collapse
No announcement yet.

Reg Query

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reg Query

    What I am trying to accomplish is when quering a registry key on a remote pc by default the dos window does not display the remote machine name.

    Example:

    ! REG.EXE VERSION 3.0

    HKEY_LOCAL_MACHINE\Software\Intel\Landesk\VirusPro tect6\CurrentVersion
    Parent REG_SZ VAFXAVS10

    now what I would like is for when selecting multiple machines and saving the output to a txt file to insert the pc's name in the txt file. How can this be accoplished? The current command I am using is:

    cmd.exe /x /c reg query "\\%E%\HKLM\Software\Intel\Landesk\VirusProtect6\C urrentVersion" /v Parent >> c:\%E%_nav_parent.txt

    which gives me a seperate .txt file for each machine. Any help would be greatly appreciated.

  • #2
    Re: Reg Query

    You'll have to experiment with this, but you should be able to put this on the end of your command:

    & echo %E% >> c:\nav_parent.txt

    Comment


    • #3
      Re: Reg Query

      I tried to place the string yuou gave me at the end and at the beginning and still no luck. By placing the string at the end the resulting text file only lists the names of the pc's and no reg info. I realize theat this is really not a hyena problem/issue but thank you for giving it a shot. If anyone else knows the correct syntax please fell free to enlighten me.

      Comment


      • #4
        Re: Reg Query

        What is the exact command you are using now?

        Comment


        • #5
          Re: Reg Query

          I tried:
          cmd.exe /x /c reg query "\\%E%\HKLM\Software\Intel\Landesk\VirusProtect6\C urrentVersion" /v Parent & echo %E% >> c:\nav_parent.txt

          OUTPUT RESULTS: only lists the machne names and ignored the reg query comand

          and cmd.exe /x /c echo %E% & reg query "\\%E%\HKLM\Software\Intel\Landesk\VirusProtect6\C urrentVersion" /v Parent >> c:\nav_parent

          OUTPUT RESULTS: only lists the reg query results and ignored the echo request for the machine name

          Sorry About That. The following command works:

          cmd.exe /x /c echo %E% >> c:\nav_parent.txt & reg query "\\%E%\HKLM\Software\Intel\Landesk\VirusProtect6\C urrentVersion" /v Parent >> c:\nav_parent.txt

          Thanks

          [This message has been edited by BKJ (edited 10-14-2003).]

          [This message has been edited by BKJ (edited 10-14-2003).]

          Comment


          • #6
            Re: Reg Query

            I meant to add it to the end of your original command like this:

            cmd.exe /x /c reg query "\\%E%\HKLM\Software\Intel\Landesk\VirusProtect6\C urrentVersion" /v Parent >> c:\nav_parent.txt & echo %E% >> c:\nav_parent.txt

            Comment


            • #7
              Re: Reg Query

              Are you querying NT4 boxes?

              If you're only checking on 2K and XP boxes, you're better off using the registry portion of WMI, of the RegObj.dll file (Reg.exe can have a difficult time with output).

              Also, it looks to me like you're querying the remote PCs to find you what the parent server is in a Symantec System Center environment...correct?
              http://www.systemtools.com/HyenaBoar...ML/000032.html

              See the April 1st, 2003 posting. The script in there can be modified slightly to produce the results you want, in any format.

              Hope this helps a little.

              Joel

              Comment

              Working...
              X
              😀
              🥰
              🤢
              😎
              😡
              👍
              👎