Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Scripting Help

Featured Replies

I am looking on advice to writing a script in preferably Batch/CMD or VBS with PERL being an option. What I am trying to accomplish is either directly writing information obtained from a command line tool into some strings / keys into the registry.

We are currently running CA Threat Manager 8.1 (AV and PestPatrol). From CA there is a command line tool called 'CompVer' that will output all the particular information related to signature version and AV base version. I either need to run this CompVer utility in a script and directly write 3 of the results into a registry key or write them out to a text file and import that into the registry.

Here is the work I've done so far:

>>>Run Compver and output to a text file<<<

REM Run CompVer and output to a textfile
@ECHO OFF
compver | Find "eTrust Antivirus Base" >> C:\ITM.txt && compver | Find "eTrust PestPatrol Signatures" >> C:\ITM.txt && compver | Find "eTrust Vet Engine" >> C:\ITM.txt
EXIT

>>>Write entries to the registry<<<

@ECHO OFF
REM Write to REG Key
REG ADD HKLM\SOFTWARE\ComputerAssociates\eTrustITM\Status
REG ADD HKLM\SOFTWARE\ComputerAssociates\eTrustITM\Status /v "eTrust AntiVirus Base" /t REG_MULTI_SZ

I am looking for some way, hopefully in the same script to write the entries inside of C:\ITM.txt into the registry. I am assuming that this would use the FOR command however I have little experience with this command when writing batch. Like I said, VBS is an option but I haven't explored it yet as I am looking for something quick.

  • Author

Here are my findings, his so far is working great. Alot of work for such a small script but it does its job. Revision 2 I guess would be a way to write directly to the registry without the need for text files. Not a bad attempt for never having used the FOR command.

@ECHO OFF
cd \
SET VAR=eTrust Antivirus Base
SET VAR1=eTrust PestPatrol Signatures
SET VAR2=eTrust Vet Engine
CompVer | Find "%VAR%" >> C:\ITM.txt
CompVer | Find "%VAR1%" >> C:\ITM2.txt
CompVer | Find "%VAR2%" >> C:\ITM3.txt
REG ADD HKLM\SOFTWARE\ComputerAssociates\eTrustITM\Status
FOR /F "tokens=4 delims=, " %%i in (C:\ITM.txt) DO @REG ADD HKLM\SOFTWARE\ComputerAssociates\eTrustITM\Status /v "%VAR%" /d %%i
FOR /F "tokens=4 delims=, " %%j in (C:\ITM2.txt) DO @REG ADD HKLM\SOFTWARE\ComputerAssociates\eTrustITM\Status /v "%VAR1%" /d %%j
FOR /F "tokens=4 delims=, " %%k in (C:\ITM3.txt) DO @REG ADD HKLM\SOFTWARE\ComputerAssociates\eTrustITM\Status /v "%VAR2%" /d %%k
DEL "C:\ITM.txt" && DEL "C:\ITM2.txt" && DEL "C:\ITM3.txt"
EXIT

You shouldn't need the temporary .txt files. :unsure:

Does this output the wanted result?

SET VAR=eTrust Antivirus Base
FOR /F "tokens=4 delims=, " %%i in ('CompVer ^| Find "%VAR%"') DO ECHO @REG ADD HKLM\SOFTWARE\ComputerAssociates\eTrustITM\Status /v "%VAR%" /d %%i

jaclaz

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.