Jump to content

Script to remove unwanted local users


Recommended Posts

the following VBscript gets me to the list of Local Users on a windows 2000 PC.

I need to find out how to continue in order to delete a given particular user, member of the "users group".

Here's what I have so far:

' Require Variants to be declared before used

Option Explicit

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' Declare Variables & Objects

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Dim oShell

Dim oAutoIt

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' Initialise Variables & Objects

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Set oShell = WScript.CreateObject("WScript.Shell")

Set oAutoIt = WScript.CreateObject("AutoItX3.Control")

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' Start of Script

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

oShell.run "mmc.exe c:\winnt\system32\COMPMGMT.MSC"

wscript.sleep 500

oAutoIt.Send "L"

oAutoIt.Send "{Tab}"

wscript.sleep 500

oAutoIt.Send "G"

oAutoIt.Send "{Enter}"

wscript.sleep 500

oAutoIt.Send "A"

wscript.sleep 500

oAutoIt.Send "{Down 5}"

oAutoIt.Send "{Enter}"

thanks for any help

I'll check for an answer tomorrow.

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...