CodeGuru
Earthweb Search
Forums Wireless Jars Gamelan Developer.com
CodeGuru Navigation
RSS Feeds

RSSAll

RSSVC++/C++

RSS.NET/C#

RSSVB

See more EarthWeb Network feeds

follow us on Twitter

Member Sign In
User ID:
Password:
Remember Me:
Forgot Password?
Not a member?
Click here for more information and to register.

Become a Marketplace Partner

jobs.internet.com

internet.commerce
Partners & Affiliates
















Home >> Visual C++ / C++ >> Windows Programming >> System >> Security


Protecting Windows NT Machines
Rating: none

Vishal Khapre (view profile)
February 13, 2001

.

Environment: Windows NT 4.0 (Server or Workstation)


(continued)



Windows NT security makes it possible to lock down a desktop so a given user has access to only one or a few specific programs. On a public kiosk computer, it is often important that user access be restricted. This article explains the steps that need to be taken to implement this before you start please read the IMPORTANT notice.

IMPORTANT: This article contains information about editing the Windows registry. Before you edit the registry, you should first make a backup copy of the registry files (System.dat and User.dat). Both are hidden files in the Windows folder. Do not run the sample .reg file which contains all the specified registry entries as a demonstration or test because doing this will disable the menus of the demonstrator and might not give him access to remove the entries also. It is advised that for demonstration, make only one entry at once. Unsolicited changes in registry might damage the system functionality in which cases author can not be held responsible.

Windows always works on its Registry entries which are stored some hidden .dat files usually the system.dat and user.dat in widows directory. It can be viewed as the settings for the individual user determining his environment in Windows NT user session. It is found that these settings or registry entries play a key role while deciding the access to individual user on any Windows NT machine. Whenever the user loggs in, Windows fetches all the settings from files, and loads it in the memory. So the user settings are stored with your windows explorer which works like shell for your Windows NT session. For making the registry entries, you can either go to RUN menu and run regedit.exe or regedt32.exe. This will open a windows similar to Windows explorer. There are five by default major categories viz. HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS,HKEY_CURRENT_CONFIG which are used for the basic functionality of the Registry and Windows security.

You can browse through and make the entries at right places.Windows also specifies a format which goes in .reg file (see the sample code), which can be run from any location. This .reg file can be edited using a simple notepad also. In this format, specify the REGEDIT4 first, to tell the version of editing utility, then you have to specify the absolute path in square brackets where this registry entry will go for example [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies] you can specify multiple paths also where the settings will be stored followed by the name of the entries which have to be made are written as

"NameOfEntry"=DataType:ValueOfTheEntry


For restricting the access, following are the names of the entries/keys and their functionality at [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies]

Key Name Functionality Data Type Value
NoFind Removes Find command from Start menu. dword 00000095
NoFolderOptions Removes the Folder Options menu item from the Settings dword 00000001
NoRecentDocsMenu Removes the Documents command from the Start menu. dword 00000001
NoDesktop Hide all items on desktop. dword 00000001
NoRun Removes Run command from Start menu dword 00000001
NoLogOff Disables the logoff options dword 00000001
NoClose Disables Shut Down command. dword 00000001
NoNetHood Hides Network Neighborhood. dword 00000001
NoDrives Hides drives in My Computer. dword 00000000
To give access to only drive C dword fbffff03
To give access to drives C and D dword f3ffff03
To give access to drives A to F dword c0ffff03
NoTrayContextMenu Removes context menus for tray including the start button, tab control, and clock. dword 00000001
NoSetFolders Remove folders from Settings/Start menu dword 00000001
NoSetTaskbar Remove Taskbar from Settings/Start menu. dword 00000001
NoFavoritesMenu Removes the Favorites folder from the Start menu. dword 00000001
NoSaveSettings Does not save settings at exit. dword 00000001
NoDriveTypeAutoRun Prevents CD-ROM drive from running automatically. dword 00000001
NoViewContextMenu Removes the context menu when you right click the desktop, or when you right click explorer in the results pane. dword 00000001
NoFolderOptions Removes the Folder Options menu item from the Settings dword 00000001

Note : NoRecentDocsMenu and NoRecentDocsHistory requires Active Desktop to be installed; otherwise they do not work


At the place [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]

Key Name Functionality Data Type Value
DisableLockWorkstation Disables the Lock workstation option from menu dword 00000001
DisableTaskMgr Disables the Task Manager dword 00000001
DisableChangePassword Disables the password change option dword 00000001

Copy the following source in notepad and save it as .reg file


REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]

"NoDriveTypeAutoRun"=dword:00000095
"NoFind"=dword:00000001
"NoFolderOptions"=dword:00000001
"NoDesktopUpdate"=dword:00000001
"NoFavoritesMenu"=dword:00000001
"NoRecentDocsMenu"=dword:00000001
"NoSetActiveDesktop"=dword:00000001
"NoDesktop"=dword:00000001
"NoSetFolders"=dword:00000001
"NoSetTaskbar"=dword:00000001
"NoSaveSettings"=dword:00000001
"NoClose"=dword:00000001
"NoNetHood"=dword:00000001
"NoRun"=dword:00000001
"NoDrives"=dword:00000000
"NoTrayContextMenu"=dword:00000001
"NoViewContextMenu"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]

"DisableLockWorkstation"=dword:00000001
"DisableTaskMgr"=dword:00000001
"DisableChangePassword"=dword:00000001

Downloads

Download instructions:

1. Save it to your disk
2. For running: Save it as .reg file, and double click
3. For editing:  You can edit it in test format or you can right click the .reg file and click on edit option.

Download demo registry source code - 1 Kb

Tools:
Add www.codeguru.com to your favorites
Add www.codeguru.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed







RATE THIS ARTICLE:   Excellent  Very Good  Average  Below Average  Poor  

(You must be signed in to rank an article. Not a member? Click here to register)

Latest Comments:
How to enable it back again - Legacy CodeGuru (06/13/2003)
Disabling Registry Keys as Administrator for another User - Legacy CodeGuru (10/01/2002)
Re: Disabling Registry Keys as Administrator for another User - Legacy CodeGuru (10/01/2002)

View All Comments
Add a Comment:
Title:
Comment:
Pre-Formatted: Check this if you want the text to display with the formatting as typed (good for source code)



(You must be signed in to comment on an article. Not a member? Click here to register)

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES