Jump to content

Performing a remote task


Recommended Posts

Hello,

I am new the autoit and have a really simple task that i'm sure someone could nock up for me in a few mins rather that me going round the houses with my non scripting brain! Basically i want to design a script that deletes to registry keys and then restarts a service on a remote computer.

I can sort of see how to do it but i can't work out how to do it on a remote computer! This is what i have so far:

;Prompting for the computer name

$computer = InputBox("Computer Name", "Please enter your computer name")

;Delete the registry keys

RegDelete("\\$computer\HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\ePolicy Orchestrator\Agent\", "Agent GUID")

RegDelete("\\$computer\HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\ePolicy Orchestrator\Agent\", "MAC ADDRESS")

;Start and Stop the service

ProcessClose("FrameworkService.exe" [, "\\$computer\C:\Program Files\McAfee\Common Framework\" ] )

Run("FrameworkService.exe" [, "\\$computer\C:\Program Files\McAfee\Common Framework\" ] )

As you can imagine it doesn't work, not sure if i'm even close!

Spencer

Link to comment
Share on other sites

Hello,

I am new the autoit and have a really simple task that i'm sure someone could nock up for me in a few mins rather that me going round the houses with my non scripting brain! Basically i want to design a script that deletes to registry keys and then restarts a service on a remote computer.

I can sort of see how to do it but i can't work out how to do it on a remote computer! This is what i have so far:

;Prompting for the computer name

$computer = InputBox("Computer Name", "Please enter your computer name")

;Delete the registry keys

RegDelete("\\$computer\HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\ePolicy Orchestrator\Agent\", "Agent GUID")

RegDelete("\\$computer\HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\ePolicy Orchestrator\Agent\", "MAC ADDRESS")

;Start and Stop the service

ProcessClose("FrameworkService.exe" [, "\\$computer\C:\Program Files\McAfee\Common Framework\" ] )

Run("FrameworkService.exe" [, "\\$computer\C:\Program Files\McAfee\Common Framework\" ] )

As you can imagine it doesn't work, not sure if i'm even close!

Spencer

Well this is a bit harder then doing it your way :) If you want to do it in non-native but i guess simpler way for you you can use

Run("") command to execute dos commands to DELETE registry keys from remote machine. Type in CMD window 'REG DELETE /?' and see what pops out. You could also use external program (and FileInclude it in your autoit proggy) like psservice which can be found here http://www.microsoft.com/technet/sysintern.../PsService.mspx from sysinternals to restart the service after your reg keys deletion.

However i have seen couple of programs on AutoIt forum that does this more or less nativly. So search forum for those. Most likely those will be in Examples Forum. You might need to cut out pieces of code and paste into yours. Choose a way for yourself. I can help a bit if you will need some help but do some work yourself first :)

My little company: Evotec (PL version: Evotec)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...