Welcome to Vhunk’s Weblog











open windows registry [ start > Run > Regedit.exe hit Enter ]
Hive: HKEY_LOCAL_MACHINE

Key: \System\CurrentControlSet\Control\Terminal Server\

Name: fsDenyTSConnections

Type: REG_DWORD

Value: 0=Enable this key, that is Remote Desktop Connection

Value: 1=Disable this key, that is Dont allow remote person to Connect to the computer

if u are an Administrator and if u want to enable remote desktop connection remotely then i have a small script..


‘======================================================
‘Script_Name :Enable_RDP_Remotely.vbs
‘Description : This script enables the Remote desktop functionality remotely
‘ The script perform registry changes. In order to apply those changes
‘ a reboot is required……

‘Remarks and Limitations : Works for WinXP and Windows 2003 Servers.
Win2000 has not been tested Yet
‘ A Reboot is required
‘======================================================

‘Error Handling, Declare Constants and Variable…
‘—————————

On Error Resume Next

Const HKEY_LOCAL_MACHINE = &H80000002
dim vbYesNo
dim vbQuestion
vbYesNo = 4
vbQuestion = 48

‘Create inputbox in order to collect the computer Name
‘—————————-

StrComputer=InputBox(“Enter Name of the Remote Computer…”,”Connect to Remote Computer”)

‘Connect to the Remote Registry using WMI space
…We assume that you have administrative rights
‘———————————

Set oReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” & _
strComputer & “\root\default:StdRegProv”)

‘Error handling…if not able to connect to the remote machine…you will be notified
‘———————————————————

If Err.Number <> 0 Then
MsgBox “Error. Computer not accessible…Possible reasons” & vbcrlf & vbcrlf &_
“1.the computer name is incorrect” & vbcrlf & _
“2.the computer is not running… ” & vbcrlf & _
“3.the currently logged-on user has no admin rights”& vbcrlf & vbcrlf &_
“End of Script”,64,”An Error occured”
WScript.Quit()
End If

‘to enable remote desktop,
‘registry key HKLM\System\CurrentControlSet\Control\Terminal Server\fsDenyTSConnections
’should be set to 0

strKeyPath = “System\CurrentControlSet\Control\Terminal Server”
strValueName = “fDenyTSConnections”
dwValue = 0
oReg.SetDWORDValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue

‘Ask the User if he wants to reboot the machine right now or do it later….
‘————————————-

retry= msgbox (“A Reboot is required in order to apply the changes” & vbcrlf & _
“Do you want to reboot the remote computer Now ?”,52,”Reboot the Remote Machine”)

Select Case retry

Case vbYes
‘WMI Code used to reboot the remote computer
Set oWMI = GetObject(“winMgmts:\\”& strComputer)
Set colComputers = oWMI.ExecQuery(“SELECT * FROM Win32_OperatingSystem”)
For Each refComputer In colComputers
If refComputer.Reboot() <> 0 Then
WScript.Echo “Reboot failed”
Else
WScript.Echo “Computer rebooted”
WScript.echo ” Action completed sucessfully “
End If
Next
Case vbNo
WScript.Echo(“Changes will not be applied for the moment”)
End Select



{June 19, 2008}   Registry keys

Windows TaskManager [Registry key to Enable and Disable]:

Hive: HKEY_CURRENT_USER
Key: Software\Microsoft\Windows\CurrentVersion\Policies\System
Name: DisableTaskMgr
Type: REG_DWORD
Value: 1=Enablethis key, that is DISABLE TaskManager
Value: 0=Disablethis key, that is Don’t Disable, Enable TaskManager

Here is an another Way to do the same :

  • Click Start
  • Click Run
  • Enter gpedit.msc in the Open box and click OK
  • In the Group Policy settings window
    • Select User Configuration
    • Select Administrative Templates
    • Select System
    • Select Ctrl+Alt+Delete options
    • Select Remove Task Manager
    • Double-click the Remove Task Manager option

And as I mentioned above, since the policy is Remove Task Manager, by disabling the policy, you are enabling the Task Manager.



Windows registry Overview :

The Windows registry is a directory which stores settings and options for the operating system for Microsoft Windows 32-bit versions, 64-bit versions, and Windows Mobile. It contains information and settings for all the hardware, operating system software, most non-operating system software, users, preferences of the PC, etc. Whenever a user makes changes to Control Panel settings, file associations, system policies, or most installed software, the changes are reflected and stored in the registry. The registry also provides a window into the operation of the kernel, exposing runtime information such as performance counters and currently active hardware. This use of registry mechanism is conceptually similar to the way that Sysfs and procfs expose runtime information through the file system (traditionally viewed as a place for permanent storage), though the information made available by each of them differs tremendously.

The Windows registry was introduced to tidy up the profusion of per-program INI files that had previously been used to store configuration settings for Windows programs.[1] These files tended to be scattered all over the system, which made them difficult to track.



et cetera