Showing results for 
Search instead for 
Did you mean: 
Level 7
Report Inappropriate Content
Message 1 of 3

sbadmcl cleanupmachinegroup script needed

I need a vb script or a bat file that i can loop through a text file containing all my machine groups.

I am trying to run the cleanupmachinegroups command via sbadmcl but the problem is i have about 200 machine groups.  I have all my machine groups listed in a text file i just need a simple bat file or vbs file to loop through that text file so i dont have to set here and run this command 200 times. 

Anyone out there with such a script or bat?

2 Replies
Reliable Contributor SafeBoot
Reliable Contributor
Report Inappropriate Content
Message 2 of 3

Re: sbadmcl cleanupmachinegroup script needed


for /F %1 in (filename.text) do echo %1

on a command line will process each line of text in a file (and echo it)

to do it in VBScript is a little harder, but gives you more flexibility.

dim oFSO : set oFSO = createobject("scripting.filesystemobject")

dim oFile : set oFile = oFSO.OpenTextFile("test.txt",1)

while not oFile.AtEndOfStream

           WScript.Echo oFile.ReadLine


will read the file line by line,

set oFSO = createobject("scripting.filesystemobject")

data = oFSO.OpenTextFile("test.txt",1).readall

data = Split(data,vbCrLf)

For Each item In data

          WScript.Echo item


will read the whole file, split it by line feeds and output it (probaby faster as there are less reads)

Finally, can't you use "*" as a group name? I know that works with some commands - not sure about the cleanup ones though.

Message was edited by: SafeBoot on 3/20/14 4:52:28 PM EDT
Level 7
Report Inappropriate Content
Message 3 of 3

Re: sbadmcl cleanupmachinegroup script needed

Unfortunatley the * wild card doesnt work with this one.  Thanks for the info though.  Ill give them a shot. 

More McAfee Tools to Help You
  • Subscription Service Notification (SNS)
  • How-to: Endpoint Removal Tool
  • Support: Endpoint Security
  • eSupport: Policy Orchestrator
  • Community Help Hub

      New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

    • Find Forum FAQs
    • Learn How to Earn Badges
    • Ask for Help
    Go to Community Help

    Join the Community

      Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

    • Get helpful solutions from McAfee experts.
    • Stay connected to product conversations that matter to you.
    • Participate in product groups led by McAfee employees.
    Join the Community
    Join the Community