0

I am trying to retrieve the version of my Mcafee DLP using a batch script.

reg query "HKEY_LOCAL_MACHINE\Software\McAfee\DLP\Agent" 

The above command gives the following output:

HKEY_LOCAL_MACHINE\Software\McAfee\DLP\Agent
    UNRSKIP    REG_SZ    skip
    AgentVersion    REG_SZ    10.0.100.372
    PackageType    REG_SZ    DLP
    CommonAppDataFolder    REG_SZ    C:\ProgramData\

How do i retrieve this line : AgentVersion REG_SZ 10.0.100.372

3
  • Parse the output string for line starting with "AgentVersion" Commented Mar 8, 2017 at 4:43
  • How do i do that? Commented Mar 8, 2017 at 4:44
  • I am no expert on batch script. Try googling 1. how you can get the output into a string, 2. how to parse the string using new line, 3. check the new lines with substring continuing "AgentVersion" on starting Commented Mar 8, 2017 at 4:59

1 Answer 1

1
reg query "HKEY_LOCAL_MACHINE\Software\McAfee\DLP\Agent" | find "AgentVersion" > tmp.txt
for /F "tokens=3 delims= " %%f in (tmp.txt) do (echo %%f)

hope this helps !

Sign up to request clarification or add additional context in comments.

2 Comments

Also, how do i add a new line as a delimiter?
You are welcome. reg. your question, am not getting it. The for statement itself parses through all lines in the file one by one.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.