Link to home
Start Free TrialLog in
Avatar of IT CAMPER
IT CAMPERFlag for United States of America

asked on

Need to edit included VB Script

I need to add to the script below...

Turn OFF Simple File Sharing for XP
Enable 'File and Printer Sharing' in the firewall exception list for XP
@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

Open in new window

Avatar of Member_2_4821270
Member_2_4821270

Did you want to use vbscript?  The code you posted is for a bat or cmd file.  I'm not sure which direction you would like to go in.  The registry settings for the two items are listed below.  

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]
Value Name: ForceGuest
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = disable "Simple File Sharing", 1 = enable "Simple File Sharing")
 
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Network]
Value Name: NoFileSharing
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = enable file sharing, 1 = disable file sharing)
 
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Network]
Value Name: NoPrintSharing
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = enable print sharing, 1 = disable print sharing)

Open in new window

Avatar of IT CAMPER

ASKER

Sorry, it does not matter which solution I use.  I failed to notice that I was using a cmd file, but that is what it is.  Can you code the reg changes so that I can add it to the existing cmd file?
SOLUTION
Avatar of Robberbaron (robr)
Robberbaron (robr)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Well, in keeping with the CMD file, the answer is right in front of you.  Just add the following to your current file.  


reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "ForceGuest" /t REG_DWORD /d 0 /f > NUL 2>&1
 
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Network" /v "NoFileSharing" /t REG_DWORD /d 0 /f > NUL 2>&1
 
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Network" /v "NoPrintSharing" /t REG_DWORD /d 0 /f > NUL 2>&1

Open in new window

jasenwebster...Simple file sharing is disabling, but the reg entries are not turning on File and Print Sharing.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Worked Perfectly!
Glad I could help.  Thank you for the points.