Thursday, March 25, 2010

Enable and disable USB data storage port

Hi,
You can enable/disable the USB data port on ur PC to secure it from other unauthorised access
Lets try this,
This is applicable on WIN XP and win 2000, On other OS I didn't tried


To enable a disabled USB port, follow these steps below
1. Click Start, and then click Run.
2. In the Open box, type
regedit, and then click OK.
3. Locate, and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor
4. In the right pane, double-click on Start.
5. In the Value data box, type
3, click Hexadecimal (if it is not already selected), and then click OK.
6. Quit Registry Editor.

very easy :)
Now to disable the USB port try this,

To disable the access to USB port follow the steps below
1. Click Start, and then click Run.
2. In the Open box, type regedit, and then click OK.
3. Locate, and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor
4. In the right pane, double-click Start.
5. In the Value data box, type
4, click Hexadecimal (if it is not already selected), and then click OK.
6. Quit Registry Editor.

Enjoy :)

Friday, March 5, 2010

Easy way to kill sessions of database in SQL 2005

This is easiest way to kill all sessions of database.

USE [Master]
GO

DECLARE @DBName VARCHAR(100)
DECLARE @SPId VARCHAR(7000)
SELECT @DBName = 'DBAdmin'

SELECT @SPId = COALESCE(@SPId,'')+'KILL '+CAST(SPID AS VARCHAR)+'; '
FROM Master..SysProcesses
WHERE DB_NAME(DBId) = @DBName
PRINT @SPId
EXEC(@SPId)
GO