cancel
Showing results for 
Search instead for 
Did you mean: 

Need to write a script.

As part of an automated install process I need to write a script that checks that the first sync has completed and then reboots the machine. Any Ideas where to start?

21 Replies

Re: Need to write a script.

Why is it that I always have a burst of intelligence after I give up and ask for help.

Posted for anyones interest or general flaming on how I could have done it better.

strCheck = 0

WScript.Sleep 120000

Set objShell = CreateObject("WScript.Shell")

objShell.Run "regsvr32.exe /s c:\program files\mcafee\endpoint encryption for pc\sbadmcom.dll"

Do Until strCheck = 1

Set objScriptExec = objShell.Exec("C:\Program Files\McAfee\Endpoint Encryption for PC\SbAdmCL.exe -command:issyncinprogress")

strSyncStat = objScriptExec.StdOut.ReadAll

    If InStr(strSyncStat, "SyncData = 0") Then

        'WScript.Echo "PASS!"

        objShell.Run "%comspec% /c shutdown /r /t 5 /f", , TRUE

        strCheck = 1

      Else

      'WScript.Echo "FAIL!"

      strCheck = 0

      WScript.Sleep 20000

    End If

Loop

Re: Need to write a script.

Good script. You get my vote.

Reliable Contributor SafeBoot
Reliable Contributor
Report Inappropriate Content
Message 4 of 22

Re: Need to write a script.

You could steal this function out of AutoDomain - there's a whole class in it which does nothing but handle SBADMCL in VBS, and it uses the COM object, so no nasty shelling out to dos..

But, what you have indeed will work fine.

mwilke
Level 7
Report Inappropriate Content
Message 5 of 22

Re: Need to write a script.

  Samuri.... your Script Fu is strong.

Re: Need to write a script.

I say it is Script-Shui or Script-Zen. Safebootsamurai can script while blindfolded!

Re: Need to write a script.

my latest creation is an overhaul to the setuser.vbs that is in the tools download. i'm creating a helpdesk tool to allow them to create users and machines, then link them without console access.

a future upgrade will allow them to view assigned users.

Reliable Contributor SafeBoot
Reliable Contributor
Report Inappropriate Content
Message 8 of 22

Re: Need to write a script.

pretty 🙂

I just wrote a couple of generic HTA's to do similar things - emulate the login box, plus get question/answer combinations. If you're interested I'll post them.

Re: Need to write a script.

I'm always interested in the things you script.

Re: Need to write a script.

i luv these, and will borrow the other if you sharing only, would love to see the new project when your done.

Also anyone know where i can get my hands on a new copy of a mini admin tool that i can use in my enviroment, lost my copy on a format.

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