Warning: Invalid argument supplied for foreach() in /home/techrecipes/public_html/wp-content/themes/techrecipes/header.php on line 77

XP Pro: Howto Enable/Disable the Security Tab via a JScript

I always find myself without the “security tab” (in regards to who as access to specific files or folders) whenever I make a clean install of Windows XP Pro.

Here we go …


Before using this, please read the “CAUTION” section at the end.

I use JScript but all it really does is change a registry key so it could be done a couple of other ways as well. The “Security Tab” is used to control who can and can’t use/view/open/modify a file/folder.

ENABLE the Security Tab:

1. Open notepad (or your favorite script editor) and past the following:
var key = "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ForceGuest";
var shell = WScript.CreateObject( "WScript.Shell" );
shell.RegWrite( key, 0, "REG_DWORD" );
var e = shell.RegRead( key );
if( e == 0 )
WScript.Echo( "Security tab enabled" );
else if( e == 1 )
WScript.Echo( "Security tab still disabled" );
else
WScript.Echo( "Error in script" );

2. Save it as ScriptName.js (where ScriptName is whatever you want to call the script).

3. Double-click on the script file and a box will pop up telling you if the security tab is enabled or not (or run it from CMD with cscript ScriptName.js and the out put will be in the CMD).

DISABLE the Security Tab:

1. Open notepad (or your favorite script editor) and past the following:
var key = "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Lsa\\ForceGuest";
var shell = WScript.CreateObject( "WScript.Shell" );
shell.RegWrite( key, 1, "REG_DWORD" );
var e = shell.RegRead( key );
if( e == 0 )
WScript.Echo( "Security tab enabled" );
else if( e == 1 )
WScript.Echo( "Security tab still disabled" );
else
WScript.Echo( "Error in script" );

2. Save it as ScriptName.js (where ScriptName is whatever you want to call the script).

3. Double-click on the script file and a box will pop up telling you if the security tab is disabled or not (or run it from CMD with cscript ScriptName.js and the out put will be in the CMD).


NOTE: To make sure that the script succeeded in doing what you wanted it to, just right-click on a file or folder and look for the “Security” tab.

The script doesn’t seem to work on XP Home. The script requires NTFS to work.

CAUTION: Playing around with the security settings on files and folders may cause damage to your system so be careful. If you don’t know how a change in the security settings will effect your system don’t do it. It’s a rather powerful tool.

The Conversation

Follow the reactions below and share your own thoughts.