Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 323
  • Last Modified:

Script to create XP or 2000 user account and disable XP firewall

I have a network backup program that I need to run on non-domain network computers.  With this arrangement, I have to create a common admin user account on each peer-to-peer workstation so that the network backup utility can access each computer.  I also have to disable the firewall on the XP workstations.  I am wanting a script solution, I can run locally on each computer, that will create a new user account with the username snapshot_admin and the password $nap$hot1234.  It needs to create the account on either 2000 or XP machines.  On XP, it needs to configure the user account NOT to show on the welcome screen, just like the default administrator account (not sure how that works).  The script then needs to turn off and disable the XP firewall, if the script is running on a local XP machine.

I am looking for a turn-key script solution.  Thanks for the help Experts!
0
murryc
Asked:
murryc
  • 2
  • 2
1 Solution
 
Shift-3Commented:
Paste the script below into a text file with a .cmd extension.  Running it will create the account, add it to the local Administrators group, hide it on the Welcome Screen, and disable the Windows Firewall.


@echo off
setlocal
 
set user=snapshot_admin
set pw=$nap$hot1234
set key=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList
 
net user %user% %pw% /ADD > NUL 2>&1
net localgroup administrators %user% /ADD > NUL 2>&1
 
reg add "%key%" /v %user% /t REG_DWORD /d 0 /f > NUL 2>&1
 
sc stop sharedaccess > NUL 2>&1
sc config sharedaccess start= disabled > NUL 2>&1

Open in new window

0
 
murrycAuthor Commented:
Easy enough!
0
 
murrycAuthor Commented:
Shift-3,

Can you add to the script for it to create a folder named snapshot on the root of c:\?

c:\snapshot
0
 
Shift-3Commented:
Add the line

if not exist c:\snapshot md c:\snapshot

Open in new window

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now