Tuesday, February 17, 2009

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

·

Bookmark and Share

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" );

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

Contributor Icon Contributed by Helgman Date Icon December 19, 2006
ShareThis Tag Icon Tagged: Windows security

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.


0 comments:

Post a Comment

Related Articles


Related Article Widget by Hoctro

About Me


嗨,我是花,居住在印度兴奋的Windows,Linux中国的外籍人士和所有高科技的东西

Hi, I am Hua, a chinese expat residing in India excited about windows, linux and all things tech

Receive updates for free

Enter your email address:

Delivered by FeedBurner

Mobile Version

Bookmark

Bookmark and Share

Blog Archive