1.

Solve : batch file to change XP pro policy?

Answer»

hi , need a batchfile that can change the policy setting/

controlpanel>administrativetools>Local security policy>local policies>security options>Network access : Sharing and security model for local accounts , by default this are set to guest only .. but i need them to change to Classic. is there any way a batchfile can do this? can you guys help me with this?pleaseYour movies suck.. just wanted to say.Ahh, I see you've met our resident movie critic . For Group Policy you need to write a script. Check out

http://www.microsoft.com/technet/scriptcenter/findit.mspx

This site has links and examples that should give you some ideas.

Good luck. hey sidewinder ... thankyou for your help .. the site really helped. its actually the same as to disable the simple file sharing.
I got a code here to disable simple file sharing ... but i cant seem to get it work on any winXP machine. could you take alook at the code. how can i change the code so that it would work on any XP pro machine.

@echo off
If {%1}=={} @echo Syntax: NoSFS ComputerName1 [ComputerName2 ... ComputerNamen]&goto :EOF
setlocal
:Next
if {%1}=={} endlocal&goto :EOF
set computer=%1
shift
set computer=%computer:"=%
set key="\\%computer%\HKLM\SYSTEM\CurrentControlSet\Control\Lsa"
if /i "%computername%" EQU "%computer%" set key="HKLM\SYSTEM\CurrentControlSet\Control\Lsa"
@echo reg add %key% /v forceguest /t REG_DWORD /d 00000000 /f
reg add %key% /v forceguest /t REG_DWORD /d 00000000 /f
@echo.
goto :Nextalso i can disable the simple file sharing if i make a registry file and add them. this is the code

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]
"forceguest"=dword:0

can i make a batch file with it???A reg file can only be used on the local machine. Scratch that idea.

Your batch file works fine on my machine. I suspect that if you were testing on your local machine, the IF statement failed because string comparisons are case sensitive. You can check that by turning @echo on and watch your file run.

Did you get any error messages, or did the logic just fail to produce the correct result?

Let us know.

Good luck. .

PS. You don't need this LINE: set computer=%computer:"=% yes ur right ... i am testing on a local machine ... i got incharge on deploying antivirus to all the users in my network. all are winxp and 2k. only winxp i have to disable the simple file sharing. im not using AD or domain server. so i tought just email this batch file and ask the user themself to double CLICK them so it would disable simple file sharing.
I got a registry file working ... but with a prompt like error will make the users paranoid . so i tought better to do a batch file.

so this is what i did ....




with echo on



how to change this so it will run on local machine when user double click them?SOMETIMES we miss the forest for the trees. The batch file is fine, just pass a computer name on the COMMAND line. (ex. NoSFS computername). You can update all the machines provided (1) the remote machine(s) share bit is ON and (2) your local machine name is entered in CAPS. (ex. NoSFS computername1 computername2 LOCALMACHINE...)

If you want each user to be able to doubleclick the file, modify the original:

@echo off
setlocal
set key="HKLM\SYSTEM\CurrentControlSet\Control\Lsa"
@echo reg add %key% /v forceguest /t REG_DWORD /d 00000000 /f
reg add %key% /v forceguest /t REG_DWORD /d 00000000 /f
endlocal
@echo.

Personally I like your version better. You can control the results better and doesn't depend on other users.

Hope this helps.


yep it helped. thanks so much for your help sidewinder. you saved me.



Discussion

No Comment Found