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

Home -> Windows -> Security

6762 views

From the computer of: Helgman (1 recipe)
Created: Dec 19, 2006     Updated: Dec 20, 2006


Add a comment

Add to:
Add to stumbleuponAdd to del.icio.usDigg itAdd to FURL

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.

Subscribe to the Tech-Recipes Newsletter

You can get tips like this delivered in your email every week!

Enter your Email

We will never, ever sell your email address or spam you.





Related recipes:

  Enable the Internet Connection Firewall Feature in Windows XP
  Spyware and Malware Removal - Links and Hints
  2k/NT/XP/2003: Free Microsoft Security Analyzer
  Wave Embassy Security : Remove all users / enrolled fingerprints
  How to Remove the Sony Rootkit XCP Uninstaller
  How To Prevent Windows XP Users From Writing To USB Drives
  Howto Install Daemon Tools without Spyware/Adware
  How to setup Security/Configuration Templates / Limit Access in Windows XP Prof
  Disable the Log Off and Turn Off Buttons in Windows
  Clear Page File At Reboot or Shutdown

 

Sponsored links

 

Login

Nickname

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.