Showing posts with label CMD. Show all posts
Showing posts with label CMD. Show all posts

Monday, 31 October 2011

How to Lock Folders Using NotePad

Everyone of us have some private files on systems which we do not want others to access them. Some hide those files on computer and some others use software to password protect them. But using a software leads to many problems like, getting system hang, also when we format our system the software will be removed automatically which causes your protected files to be public.
So , it is good to password protect a file on computer using a simple notepad trick by using .BAT extension.
folderlock using notepad
  •   Open Notepad and paste the following program in the notepad.
cls
:End
@ECHO OFF
title Folder Locker
if EXIST “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” goto UNLOCK
if NOT EXIST Locker goto MDLOCKER
:CONFIRM
echo Are you sure u want to Lock the folder(Y/N)
set/p “cho=>”
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Locker “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
attrib +h +s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
echo Folder locked
goto End
:UNLOCK
echo Enter password to Unlock folder
set/p “pass=>”
if NOT %pass%==Rounak goto FAIL
attrib -h -s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
ren “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” Locker
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Locker
echo Locker created successfully
goto End
  • In the above program I am using Rounak as the password of the file.
  • Replace it with anything you like to make it as folder password.
  • Save the file anywhere in the system with a .bat suffix like  something.bat
  • Here I am saving it as mylocker.bat on my system.
locker using notepad
  • Double click on the something.bat file which you create, a new folder by name Locker will be created on the same location of bat file you saved.
  • Copy your files to this folder and open bat file again and type y and then enter to lock your folder.
folder locker
  • To unlock your file again, you need to open the bat file and enter your password.

Friday, 14 October 2011

Repairing Ur Windows XP in just 8 Commands

Millions of people across the globe turn off the computer and go to bed every night, but a few of us have turned our PCs on the next day not to the standard Windows XP loading screen, but instead to thos most dreaded of errors.

Most of us have seen it at one time or another; perhaps on our own PC, the PC of a loved one, or perhaps a PC at your place of employment. The system spends weeks or months operating in a smooth fashion, taking you to the far reaches of the wide, wibbly web, and after one particularly late evening of browsing and gaming, you shut your PC off and go to bed. Millions of people across the globe do just this every night, but a few of us have turned our PCs on the next day not to the standard Windows XP loading screen, but instead this dreaded error:
image









                                                                                                       
Windows could not start because the following file is missing or corrupt:
\\WINDOWS\\SYSTEM32\\CONFIG\\SYSTEM
You can attempt to repair this file by starting Windows Setup
using the original Setup CD-ROM.

Select ‘R’ at the first screen to start repair.
Which renders your PC inaccessible from the standard boot procedures of Windows XP. You try safe mode, to no avail. You’re particularly savvy and try issuing the FIXBOOT and FIXMBR commands in the Windows recovery console, but after each reboot, you’re merely greeted with the same obnoxious and terrifying blue screen of death that’s preventing you from accessing your precious data.
Perhaps you’ve also seen these error screens:
Windows NT could not start because the below file is missing or corrupt:
X:\\WINNT\\System32\\Ntoskrnl.exe_________________
Windows NT could not start because the below file is missing or corrupt:
X:\\WINNT\\System32\\HAL.dll_________________
NTLDR is MissingPress any key to restart_________________
Invalid boot.iniPress any key to restart
Allow me to build tension by prefacing the end-all/be-all solution with my background: Having worked for the now-incorporated Geek Squad branch of Best Buy Corporation for the better part of eight months, I have seen dozens upon dozens of systems come through our department with any one of these errors, brought in by customers who are afraid they did something, have a virus, or are in jeopardy of losing their data. Prior to my discovery of an invaluable sequence of commands, our standard procedure was to hook the afflicted drive to an external enclosure, back up a customer’s data and then restore the PC with the customer’s restore discs or an identical copy of Windows with the customer’s OEM license key. If the customer wasn’t keen on the applicable charges for the data backup, we informed them of the potential risks for a Windows repair installation (Let’s face it, they don’t always work right), had them sign a waiver, and we did our best.
Neither of these procedures are cheap in the realm of commercial PC repair, nor do they inspire a tremendous level of confidence in the technician or the hopeful client.
In an effort to expedite our repair time and retain the sanity of myself and other technicians, I received permission to undertake a case study on a variety of PCs currently in service that exhibited any of the aforementioned symptoms, and I took it upon myself to find a better solution. After crawling through the MSKB, Experts Exchange, MSDN and sundry websites all extolling the virtues of a solution to these problems, I only found one that worked, and it has been reliably serving me for the better part of two weeks on seventeen PCs to date.
The process is simple: Get to the Windows Recovery Console for your particular Windows installation, navigate to the root letter of your installation (C: in most cases), issue eight commands, and reboot. The cornerstone of this process is a command called “BOOTCFG /Rebuild” which is a complete diagnostic of the operating system loaded into the recovery console; the purpose of the command is to remove/replace/repair any system files that were preventing the operating system from loading correctly. Amongst the files it fixes are:
  • Windows Hardware Abstraction Layer (HAL)
  • Corrupt registry hives (\\WINDOWS\\SYSTEM32\\CONFIG\\xxxxxx)
  • Invalid BOOT.INI files
  • A corrupt NTOSKRNL.EXE
  • A missing NT Loader (NTLDR)
The command process may apply to other types of blue screens or Hive/HAL/INI/EXE/DLL-related stop errors, but I have not had the luxury of computers in this type of disrepair. The process I am about to outline is virtually harmless, and if you feel you may be able to correct your PC’s boot-time blue screens and stop errors with the sequence, feel free to try.
Let us now begin with a step-by-step instruction for correcting these issues.


Getting to the Windows Recovery Console

  1. Insert your Windows XP CD into your CD and assure that your CD-ROM drive is capable of booting the CD. Configuring your computer to boot from CD is outside of the scope of this document, but if you are having trouble, consult Google for assistance.
  2. Once you have booted from CD, do not select the option that states: “Press F2 to initiate the Automated System Recovery (ASR) tool.” You’re going to proceed until you see the following screen, at which point you will press the “R” key to enter the recovery console:
xp_src_welcome
  • After you have selected the appropriate option from step two, you will be prompted to select a valid Windows installation (Typically number “1″). Select the installation number, (As mentioned, “1″ in most cases), and hit enter. If there is an administrator password for the administrator account, enter it and hit enter. You will be greeted with this screen, which indicates a recovery console at the ready:
xp_src_console


Proceeding With the Repair Functions

  • There are eight commands you must enter in sequence to repair any of the issues I noted in the opening of this guide. I will introduce them here, and then show the results graphically in the next six steps. These commands are as follows:
    • C: CD ..
    • C: ATTRIB -H C:\\boot.ini
    • C:ATTRIB -S C:\\boot.ini
    • C:ATRIB -R C:\\boot.ini
    • C: del boot.ini
    • C: BOOTCFG /Rebuild
    • C: CHKDSK /R /F
    • C: FIXBOOT
  • To “Go up a directory” in computing is to revert back to the directory above the current folder you’re operating in. If, for example, I’m in the C:WINDOWSSYSTEM32 directory, and I want to get at a file in the WINDOWS directory, I would merely type CD .. and I would be taken out of the SYSTEM32 folder and up one level to WINDOWS. We’re going to do the same thing here from the WINDOWS folder to get to the basic root of C:
xp_src_recurse
Now that we are at C: we can begin the process of repairing the operating system
and that begins with modifying the attributes of the BOOT.INI file. Briefly, BOOT.INI controls what operating systems the Windows boot process can see, how to load them, and where they’re located on your disk. We’re going to make sure the file is no longer hidden from our prying eyes, remove the flag that sets it as an undeletable system file, and remove the flag that sets it as a file we can only read, but not write to. To do this, we will issue three commands in this step:
  • C:ATTRIB -H C:\\BOOT.INI
  • C:ATTRIB -R C:\\BOOT.INI
  • C:ATTRIB -S C:\\BOOT.INI
to remove the Hidden, System and Read Only flags.
xp_src_attributes
Now that we’ve modified the attributes for the BOOT.INI file, it’s up for deletion. The syntax for it is simple: { DEL | FILE NAME }, e.g., C:DEL BOOT.INI deletes the BOOT.INI file.
xp_src_delete
Now for the most important step of our process, the BOOTCFG /REBUILD command which searches for pre-existing installations of Windows XP and rebuilds sundry essential components of the Windows operating system, recompiles the BOOT.INI file and corrects a litany of common Windows errors. It is very important that you do one or both of the following two things: First, every Windows XP owner must use /FASTDETECT as an OS Load Option when the rebuild process is finalizing. Secondly, if you are the owner of a CPU featuring Intel’s XD or AMD’s NX buffer overflow protection, you must also use /NOEXECUTE=OPTIN as an OS Load Option. I will demonstrate both commands for the purpose of this guide, but do not set NOEXECUTE as a load option if you do not own one of these CPUs. For the “Enter Load Identifier” portion of this command, you should enter the name of the operating system you have installed. If, for example, you are using Windows XP Home, you could type “Microsoft Windows XP Home Edition” for the identifier. This gives the process some authenticity, if you’re keen on being a perfectionist.
xp_src_rebuild
This step verifies the integrity of the hard drive containing the Windows XP installation. While this step is not an essential function in our process, it’s still good to be sure that the drive is physically capable of running windows, in that it contains no bad sectors or other corruptions that might be the culprit. No screenshot necessary here! Just type CHKDSK /R /F at the C:> prompt. Let it proceed; it could take in excess of 30 minutes on slower computers, when this is finished move on to the seventh and final step.
This last step also requires no screenshot. When you are at the C:> prompt,
simply type FIXBOOT. This writes a new boot sector to the hard drive and cleans up all the loose ends we created by rebuilding the BOOT.INI file and the system files. When the Windows Recovery Console asks you if you are “Sure you want to write a new boot sector to the partition C: ?” just hit “Y,” then enter to confirm your decision.


Results and wrap-up

It’s time to reboot your PC by typing EXIT in the Windows Recovery Console and confirming the command with a stroke of the enter key. With any luck, your PC will boot successfully into Windows XP as if your various DLL, Hive, EXE and NTLDR errors never existed. You’ve just saved yourself from many hours of work, frustration, potential data loss and shelling out your hard-earned greenbacks at a brick’n'mortar operation.


Tuesday, 11 October 2011

Some Must Have Replacement After Fixing ur PC from Virus


When a good and powerful virus infects a computer, most likely it will disable you from running Task Manager (taskmgr.exe), Registry Editor (regedit.exe), Command Prompt (cmd.exe), System Configuration Utility (msconfig.exe), configuring Folder Options and hide the Run from Start Menu. Reason the virus does that is because most of the time it is “possible” for computer experts to remove the virus by using the built-in Windows programs without any third party tools.

Command Prompt replacement
But if you can’t run Task Manager, you cannot end the suspicious process. You could use the taskkill command in command prompt to kill the process but again you won’t be able to do that if CMD has been disabled. Perhaps you can run msconfig to stop the virus from auto startup but also cannot because of the virus. For advance computer users who has knowledge in registry and thought that they could manually remove the virus auto startup entries there, they too can’t do anything about it if regedit has been disabled. Disabling of Folder Options is to stop you from setting your computer to display hidden and system files. This way you can’t see the virus file and hence you won’t be able to delete them.

It is easy to re-enable all those tools back by modifying some values in your registry but if the is still virus active in your computer, the restrictions will be restored back. So for emergency cases, here are some replacement tools you can use to replace the disabled Windows tools.


1. Task Manager taskmgr.exe Replacement
taskmgr alternative
- Task Manager is very important because that is where you get to see all the running processes and also the amount of memory and CPU usage. If you find anything suspicious there, you can try terminating it. If you cannot run Task Manager and get the error message “Task Manager has been disabled by your administrator”, you can try using Process Explorer. It is portable and you can save it in your USB flash drive.

2. Registry Editor regedit.exe Replacement

Regedit alternative
- Without the ability to access Windows registry, you cannot manually make any changes at all. You can however, import registry REG files. When a virus has disabled regedit, you should see the message “Registry editing has been disabled by your administrator” when you try to run it. A good regedit alternative is RegAlyzer, developed by the author of the famous SpyBot. RegAlyzer requires installation but you can copy the whole RegAlyzer folder to your USB flash drive and run it as portable application.

3. Command Prompt cmd.exe Replacement

CMD alternative
- Command Prompt is a very powerful command line tool which supports a lot of commands when you find it impossible to do it in Windows. If you try to run cmd and get the following message “The command prompt has been disabled by your administrator. Press any key to continue”, you can try using GS. GS is a cmd replacement but it is a little old, dated back in year 2005. We’re not looking for a permanent replacement, so it is good enough as long as it can support some important command lines. Do take note that “Console2″, is an EXTENSION for command prompt. If cmd is disabled, Console2 won’t work. GS is small, free and portable.

4. Run Dialog Box Replacement

Run alternative
- Some virus will also remove the run command from your Start Menu and it is not easy to restore it back. Although this is not really important, but it could easily allow you to run important commands. Run dialog replacement v1.0 is small, only 48KB in size and portable. If you have Process Explorer, you can also access the run command from File > Run, or just hit CTRL+R.

5. System Configuration Utility msconfig.exe Replacement

msconfig alternative
- MSCONFIG is the first place that I will go to check if a computer has a virus. If you run msconfig and go to the Startup tab, it will list all programs that will start when Windows is booted up using the common startup method. Virus makers are aware of this and usually they will either delete your original msconfig.exe file or change the reference location in registry. You should get this message “Windows cannot find ‘msconfig’. Make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search.” when type msconfig at the run dialog box. One very good msconfig alternative is definitely Autoruns, which is from the same author as Process Explorer. Autoruns has the most comprehensive knowledge of auto-starting locations of any startup monitor, shows you what programs are configured to run during system bootup or login.

6. Enable Show hidden files and protected operating system files

Folder Options alternative
- I’ve tried many File Managers and most of them inherits the Show Hidden Files and Folders or Hide protected operating system files from Folder Options settings in Windows. If a virus is still active in memory, it will keep on changing the settings to disable you from viewing hidden and system files. I found one free file manager called FreeCommander which is able to show you all hidden files and folders as well as protected operating system files no matter what is the settings in Folder Options. It actually ignores the permission in Folder Options! It is portable, so you can also copy the whole extracted folder to your USB flash drive.