Showing posts with label MS DOS Commands. Show all posts
Showing posts with label MS DOS Commands. Show all posts

After your computer infected by virus, usually your Windows XP system files got some errors or corrupted. And that's not by virus only the cause of corrupted files, the error of system file can caused by installer that replace file system or hard drive bad sector or another reasons those we're not realized. And we can see the error from the shown problems. The problems are from trouble when computer can't shutdown, several softwares can't open, and Windows is slow downed. So, try to check your files system first to initiating the problems and Microsoft has been give the tool freely.

The tool is sfc command. To use sfc command is very easy, just type sfc /parameter at MSDOS prompt to execute it then your files system will checked.
SFC command will check the version all of your Windows XP file system and if sfc find the version is older, sfc will replace with original file version that taken from Windows XP Setup CD.
And here are the list of sfc parameters:

  • /SCANNOW Scans all protected system files immediately.
  • /SCANONCE Scans all protected system files once at the next boot.
  • /SCANBOOT Scans all protected system files at every boot.
  • /REVERT Return scan to default setting.
  • /PURGECACHE Purges the file cache.
  • /CACHESIZE=x Sets the file cache size.

For example, if you want to scan your file system immediately, type sfc /scannow at your MSDOS prompt. So, to using it, open your MSDOS console first by click Start - Run, type cmd in textbox then hit Enter.

And don't forget to prepare your Windows XP Setup CD, because sfc command will asked for replace the changed file system that found during scanning progress.

After wrote an article about copy command, I want write article about xcopy article this time. Copy and xcopy commands have the same function are copy a single file or multiple files to a destination. Compared with copy command, xcopy command has more parameters, so with those added parameters you can make more complex copying command.

So, if you don't satisfy with copy command, instead use xcopy command.
Use xcopy command with this syntax : xcopy [source] [destination] /parameters.
And here are the parameters list:

  • /p : if you use this parameter, everytime the destination file will written, you will prompted.
  • /c : the interpreter will continue even the xcopy command encounters errors while the files being copied. By default, if the command get an errors for during progress copying, the interpreter will stop the xcopy progress.
  • /w : this parameter will makes you'll prompted before the copying progress begin with message : Press any key to begin copying file(s), so the user allowed to insert the flash disk or floppy.
  • /v : like copy command, this parameter to verify every copied file.
  • /q : this parameter to suppress the display of xcopy command messages. The messages contain filenames that are being copied.
  • /f : to display full path of source and destination files during xcopy progress. By default, xcopy display the filenames only.
  • /l : To display a list of file that are to be copied, but actually the files are not copied.
  • /g : to store files in a decrypted state at the destination. You can use this parameter when the destination does not support encryption.
  • /d:[MM-DD-YYYY] : used to copy only those files that have changed since the specified date in MM-DD-YYYY date format. The older files do not be copied.
  • /u : To copy files from source which the files are already exist in the destination.
  • /s : this parameter will copy all subdirectory inside your current directory, but the empty directory doesn't copied.
  • /i : with this parameter, xcopy will check the existing destination folder, if it doesn't exist xcopy will prompt you to created it.
  • /e : like /s parameter, this parameter will copy all files including the sub directory and the empty sub directory will copying too.
  • /t : this parameter will makes xcopy copy the folder structure only and the files don't copied.
  • /k : this parameter to retain the read-only attributes of files and directories after the progress have finished. By default, xcopy will remove read-only attribute.
  • /r : to copy the source files to read-only destination directory. By default, xcopy will skips if the destination folder has read-only attribute.
  • /h : to copy the source files which have hidden attributes. By default, xcopy will ignore the hidden files.
  • /o : to copy the ownership and discretionary access control list information with your files.
  • /n : this parameter will change your long filenames source files to 8.3 format.
  • /x : to copy the system access control list and audit settings of the source files.
  • /a : this parameter used to copies only those files that have their archive bits set. It does not change them.
  • /m : this parameter is contrary with /a parameter.
  • /exclude filename1 + filename2 : to exclude a file or a list of files from copying progress.

These are the examples of xcopy :
xcopy my*.* c:\data /d:08-13-2007, this command will copy all files that have suffix filenames my and have changed since 08-13-2007 to c:\data folder.

So, you can compare copy and xcopy commands and then choose it...

Copy is one of the most important commands in MS-DOS console. As its name, copy command has function to copy a single file or multiple files to a destination folder or a COM or LPT port (usually in binary format). With copy command you also can create a text file or combines multiple file to a single text file. Also you need to know that copy command is internal command, that's means the command is included in command.com file. So you wouldn't find the copy.exe or copy.com inside Windows folder.

Obviously, copy command is an important command for us, especially if you're a MS-DOS user.
Copy command has syntax : copy /parameters [source] [destination]
Copy command has several parameters. These are its parameters :

  • /d : this parameter save destination as decrypted file if the source is encrypted file.
  • /v : this parameter to verify that the files are copied and written to the destination correctly.
  • /n : this parameter to save destination file as per 8.3 filename format.
  • /y : to suppress the warning message when the file being copied will overwrite an existing file with the same name at the destination.
  • /-y : contrary to /y parameter, this parameter will display the warning when the being copied will overwrite an existing file in destination folder.
  • /z : this parameter is used to copy file from a network destination in resume mode. So if you lost connection when copying from a network destination, repeat to copy again with this parameter.
  • /a : will copy source file in ASCII format, you must put the parameter after source or destination.
  • /b : will copy source file in binary format, you must put this parameter after source or destination, for example : copy source.txt /a c:\data.
  • + : use this when you want to combines multiple file, for example : copy 1.txt + 2.txt + 3.txt result.txt

That's it. You can combine them for your own need. So I want to write some examples :
copy 1*.txt c:\data (using wilcard to copy all files which have first letter of filename 1 to data folder)
copy 1.txt /a > LPT1 (to send file 1.txt contain to device that connected to LPT1 port.)
copy 1.txt 2.txt (will copy 1.txt to 2.txt, so you have 2 files identically but with different filename)

And once again, you also can create a text file with copy command, like this : copy con 1.txt [hit enter] then type your text and then if you already finish, typing press Ctrl + Z keys to save it and then 1.txt file will created.

Indeed, there so many people’s like using Windows Explorer than copy command because Windows Explorer works in GUI mode but copy command has positive side too. With copy command you can use /z to resume the unfinished copying progress in local network, you can send to certain device through port, and you can use it into batch file to create powerful routine commands.

This morning, I was ask to my friend to send me an email that containing his directory structure inside his hard drive because he wanted to print his directory structure for his DVD backup. But he did confusing about capture all his directory structure into a single text file.

Then I looked a solutions to help him to capture it. And I already look Windows Explorer and I don't found it. And I remember a MSDOS command to query all directory structure. This tool calls TREE.
OK, if you want to capture it too, open your MSDOS console first (click Start - Run, type cmd then hit Enter). To display your only structure of directory/folder just type tree at your prompt console. Tree command will display all folders and sub folders inside your current folder. So, if you're inside C:\Data folder and your type tree in there, so tree will display all C:\Data sub directories/folders. So if you want to capture your entire folders, make sure, you're in root directory (C:\) or you can also type tree c:\ to do a same action.
Tree command has 2 parameters :
1. /F, Displays the filenames in each directory as well as the directory names. For example : tree /f.
2. /A, Give you a result in ASCII mode. For example : tree /a.
And remember like I has say at above, if you don't include a folder name as its parameter, tree will display directory structure that located inside your current folder but if you want to display folder outside your current folder and you don't want to change folder just type tree c:\data (change c:\data parameter with your own target directory).
OK, we already learn about display our directory structure in screen. Now, back into main article, how to insert the result into a single file ? That's so easy, just add > [namefile_output]. For example, if you want to record c:\data structure into a file, type : tree c:\data /a > data_structure.txt. Why do I use /a parameter ? Because for compatibility issue, better save it in ASCII format.
Hopefully, this article giving some helps for you ....

Do you know, if you delete a single file or many files, those files can recovered again ? So, your files are not safe yet. If your files is secret files so you must wipe it to make it be unrecovered and anyone who want to recover your files will failed. You can find so many wiper softwares out there. But just save your money, because Windows XP already bundling a tool to do that job and if you're not satisfy with this tool try to choose 3rd party tools.

The tool calls cipher.exe. Actually, this tool has function to encrypt your files. But it has a parameter to doing as a deleted files wiper. Cipher will overwrite the delete files and moving it randomly to other hard drive sector. So Recovered Software will difficult to recover those files.
OK, to using cipher, open your command prompt console first (by click Start - Run, type cmd then press Enter). Type cipher /w:(your folder), for example : cipher /w:c:\smc.
Then cipher will cleaning up the smc folder and your deleted files inside that folder become unrecoverable.

Do you ever work in a folder which has long path ? For example, a week ago I'd installing Apache Web Server in my Windows XP and it installed at C:\Program Files\Apache Software Fondation\Apache2.2 folder. And when I want to change its configuration file or my website files, I always digg inside to Apache folder and I think that's not efficient until I found a old tool that can help me to make my job be easier.

The tool is subst command, this tool has function to substitution a folder path be a drive letter. For example my C:\Program Files\Apache Software Fondation\Apache2.2 folder path can substitution be T: drive (or others unused drive letter). So, if it has change to a virtual drive, I just have to type T: to enter my Apache folder, and sure, you can change Apache folder with yours.
OK, to execute it, open your command prompt console first, to open it, click Start - Run menu; type cmd in textbox then hit Enter key. At your console prompt type : subst (your chosen drive letter) (your long long path), for example : subst t: C:\Program Files\Apache Software Fondation\Apache2.2 then press Enter key to execute it. If you difficult to type your folder path, just press initial folder name then press Tab key until your folder displayed and so on for sub folder. For example type subst t: c:\Pr(press Tab here until Program Files name displayed); then type \ and then type Ap (press Tab here until Apache Software Fondation name is displayed) and so on, you can read the detail about power of tab key article here ....
After you've execute the subst command, then open your My Computer to browse for new virtual drive. Now, your folder has represents by a drive letter.

If you bore with your Command Prompt console title, Microsoft had provide command tool to change it. That's very easy command.

To execute it, open your command prompt console first, click Start - Run menu then type cmd in textbox then press Enter key. At your prompt type title (new title), for example : title My Favorite Console then press Enter key. And your command prompt title will changed.

I have a small office and have 5 computers inside it that connected by LAN (Local Area Network). And each computer share few folder so as our can connected each others. But sometimes I am forgeting my shared folders list in my computer.

Actually, I can find it one by one but I think that's not efficient. And I try to explore all net command parameters. As you know net command is good tool to explore and manage even send message in our Local Area Network. So, I've found it, to display all your shared folder with net command, just type net share on your command prompt. And your shared folder will displayed on your screen. And need to remember net command is command prompt tool so you need to open your command prompt console first. Just click Start - Run and then type cmd in textbox and then hit Enter key to open your command prompt console.

If you're a MSDOS user since 13 years ago maybe you still remember about config.sys and autoexec.bat that have function to set our MSDOS variable. That's long time ago. But do you know Windows XP still using a part of syntax to set its Environment Variable ?

If you want to display variable environment in GUI mode going to right click My Computer icon then click Properties menu (you can also open it through Control Panel - System). Click Advanced tab then click Environment Variables button and your Environment Variables will displayed.
And second way, open your Command Prompt console by typing cmd in your Run menu textbox, then type set at your prompt console and you'll get all your variables. Then you can check your variable such as PATH variable.

I've writing an article about speed up NTFS partition and maybe your file system still using FAT32 or even FAT. So, just upgrade your file system to NTFS so as being more secure, saving space and fast.

Microsoft is already provide the tool to convert it. You can use the tool in command line environment. And the tool calls convert.exe.
First, open your Command prompt via click Start - Run then type cmd in textbox then press Enter key.
To convert your file system you can type : convert (drive:) (fs:converted file system), for example if you want to change your c: drive become NTFS, type : convert c: /fs:ntfs. To display all its parameters type convert /?. And here are the parameters :

  • /FS:ntfs | A required parameter that implies that the volume, drive, or mount point is to be converted to NTFS file system.
  • /v | Used to display all messages and prompts before, during, and after the conversion.
  • /x | Used to dismount a volume, if required, before the conversion process starts.
  • /nosecurity | Used to remove all security settings for the directories in the specified drive or volume, making the volume accessible to everyone.
  • /cvtarea:FileName | Used by advanced users to specify a contiguous file located in the root directory to become a placeholder for the NTFS system files, which are usually the MFT and metadata files. Using this parameter prevents fragmentation of the volume after conversion.
And after you command your computer to convert, you'll asked to restart the computer and when Windows XP boot up, the convert progress will started. Just wait for it, and when the progress has done your file system will be NTFS.
And please, don't forget to backup your data first if you want convert your file system.

Do you ever plan to send a message to your work friend who connected on office Local Area Network (LAN) and often forgeted ? So, I want to give an idea to make it doesn't happened again. The idea is combine between scheduling tasks with net command and if you want to read more detail about how to create schedule tasks click here or if you want learn about net command click here.

If you have read those articles we can learn now :
First, about scheduling tasks using command line and I've choose at command to do this job because at command is more simple than schtasks command although you can create more sophisticated tasks with schtasks command. As you know that at command can run with this parameters => at <"type your command">, for example : at 6pm /every:monday "myfavourite.bat"
Second, to send a message to other client on Local Area Network use net command, to use it type : net send <"message"> for example : net send otakatik_admin "Please shutdown your computer" and you pleased to remove quote marks.

I am ensuring you've look my point. Now, this time to combining those commands, just type : at 11:50am /every:monday,friday "net send otakatik_1 Don't forget to make weekly report !". With that schedule task, you have create task to send a message to your computer friend every monday and friday at 11.50am and you're never forget to send a message again.
Just let your computer that do it for you.
You can change the command to your own command. And make your job be easier.

Hi, I install and uninstall so many freeware application in my Windows XP almost everyday and I often be confused about its impact. And I get error everywhere in my Windows. So I must fix all messes in there. And one of "messes" is my file association be destroyed too.
And first step that I take is checking file association now, where it be linked. For example, usually my .doc file was association to Microsoft Word but maybe after I install OpenOffice and uninstalled it but .doc file still refer to OpenOffice application.
You can check it via Tools - Option menu on Windows Explorer. But I am more like to check it via command prompt console (MSDOS) command. OK we will try it.
First, open Command Prompt Console, you can do it via Start - Run menu and then type cmd in textbox or via Start - All Programs - Accessories - Command Prompt menu.
Then use assoc command to check it. Just type assoc at prompt to display all file associations.
Or if you want to check certain file extension type assoc ., for example assoc .doc then your .doc file association will displayed as its result.

After wrote several MSDOS commands articles, then I want to write about creating batch file this time. Batch file is collection of multiple commands in a single file to execute them in one shot. Is it be helpful ? Sure, if you have some routine commands or commands collection that has to execute them in sequence order so you'll need to create batch file.

The most popular of batch file is autoexec.bat. In autoexec.bat the commands that will be loaded in startup will put in there, you startup variable also has set in autoexec.bat file. In MSDOS age or Windows 95, autoexec.bat has importance task to loads all startup item an creating some variable like PATH variable and the other else but in Windows XP 'the jobs' has been took by Windows Variable Environment setting.
By default, every batch file that you create, you must give it .bat or .cmd extention. You can create it using text editor such as Notepad or if you're in MSDOS mode, use copy con command to create it :
> copy con batch_name_file.bat
type your commands here command_1 command_2
(if you have complete it type Ctrl-Z key)
For example, if you want to create batch file that will browse Windows folder content, type them like this :
> copy con browse_windows.bat @echo off REM change current work path to Windows folder ECHO Change current folder to Windows folder cd\windows REM Browse them all ECHO Execute dir command dir | more ECHO Finished .....
(press Ctrl-Z)
(you can create it using Notepad too, so you can correct it if you make some mistakes and if you're ensuring all is right, save it)

OK, we'll analize it now, @echo off is command to hide the ECHO text in result for every ECHO command that executed; REM is command to make a comment (skip by interpreter), ECHO is command to display a message in result. So you can look it that to make batch files you don't need to be a programmer because the sintax is very simple.

Now, we will learn to create batch file using parameters in it. If you will include some parameters in batch file just use %1, %2, .... variable.
For example, if you want browse 2 different folders directly, create batch file like this one :
>copy con look2.bat @echo off ECHO First folder dir %1 ECHO Second folder dir %2 ECHO Finished.....
(Ctrl-Z)
and to use it, type look2 c:\windows c:\data, and it will display Windows folder first and data folder in second order.

Another commands are :
1. PAUSE, to suspend processing of the batch file, usually this will used if you asked user to insert CD-ROM/Floppy/USB, like this :
@echo off ECHO Insert source device, Floppy or CD ROM or USB PAUSE copy c:\data %1 ECHO Completed....
From the example above, you can learn the using of PAUSE command, before copy c:\data %1 will executed, the user asked to source device first and when the user has insert the source device then press ENTER key to continue next commands.

2. CALL, to calls another batch file, to use it, just give command CALL my_another_batch_file.BAT.

3. GOTO, to jump to certain marked section, like this one :
@echo off ECHO CHKDSK will executed, press any key to continue.... CHKDSK %1 /f IF NOT errorlevel 1 GOTO END ECHO An error accurred..... :END
From example above, if CHKDSK command runing propery and don't get any errors, bath file jump to :END section.

4. IF, batch command file for conditional processing, the example avaiable at point number 3, IF CHKDSK get no error, it will jumped END section and its will controled by IF command.

5. CHOICE, command to suspend processing of batch file and prompt to user to make choice for some options given. To use it just type this in your batch file CHOICE /c YN /t 10 /d N /m "Press Y for Yes or N for No" and if executed, the result will display this message Press Y for Yes or N for No [Y/N], unlike PAUSE command that just ask the user to press any key to continue the process of the batch file.

6. SETLOCAL and ENDLOCAL
SETLOCAL to sets temporary added environment variables and ENDLOCAL to ends localization of variable that set by SETLOCAL, like this :
@echo off ECHO Set temporary variable SETLOCAL PATH=%PATH&; c:\old_PHP; c:\old_data CALL old_script.bat ENDLOCAL
From above we can look that PATH variable will added with c:\old_PHP and c:\old_data and when ENDLOCAL command has executed, those added path will removed.

7. FOR, repeats the processing of a command for each file in a group of files, look below for example :
FOR %%A in (C:\DATA\*.xls) do (ECHO %%A)
Variable %%A will change to all .xls files in C:\DATA folder and for each .xls file will displayed as a result until all .xls in C:\DATA have displayed.

8. SHIFT, To change the position of batch parameters in a batch file from %0 through %9 and will copy current parameter to previous paramter, for example if you use parameters from %0 - %4, %4 will copied to %3, %3 to %2 and so on.
Fiuhhhh... I am very sleepy now, hope this article can help you... then I want go to bed now.

I ever wrote about MSDOS commands in my previous articles and dir command is included. And this time, I want write the detail about dir command. If you a MSDOS user, I am ensuring you know about this command hehehehe. Yup you're right dir command is to browse your files in computer storage including harddisk, floppy disk, cdrom, dvdrom and else. And I want write about parameters of dir command.

Don't forget to press ENTER key every you has type commands that I write below.
1. Type dir to browse all you files and folders in current disk/folder, hidden files and hidden folders are not shown in the result.
2. Type dir/ah to display hidden files and folders only in current disk/folder.
3. Type dir/as to display system files and folders only in current disk/folder.
4. Type dir/ar to display read only files and folders only in current disk/folder.
5. Type dir/b to display file name only without its details in current disk/folder.
6. Type dir/d to display file name in column format and sorted (the result like dir/w result).
7. Type dir/x to display like normal and its sort file name if it's available.
8. Type dir/og to display folders first then continued by files.
9. Type dir/os to display files and folder in sorted format by file size.
10. Type dir/ad to display just folder in current disk/folder.
11. Type dir/w to display files and folders in current disk/folder in wide format and without its detail.
12. Type dir/p to display the result page by page, press ENTER key to continue display next page.
13. Type dir | more to display its result in line by line format, press ENTER to display next line and press SPACE key to complete it.
You can save the result of command into preformat text file with add parameter > namafile, for example dir > hdd_content.txt, then you can open that file with text editor (such as notepad).
Hopefully, this article may help you.

Hi, we meet again to discuss MS-DOS (again...). This time I want to write about how to grouping one or more commands in one line command. I think this's a simple article but on other hands if we can use it you can make MS-DOS command be more efficient. And if you in Windows XP GUI mode maybe you cann't give them command group like this easier. You may to make batch file to save them so next time you just execute the batch file. And I know maybe you think UNIX commands more powerful but you can also make 'powerful' commands with MS-DOS group commands.
OK, I hope you'll get 'something' after read this article :

  1. Using & character to make sequential processing.
    You can execute two commands in one processing with "&" character, to use it just type command1 & command2, when Enter pressed so computer will process command1 and then command2. For example you can make a folder first and then copy a file to its folder, for illustrating that look this, md c:\test & copy c:\document\today.doc c:\test. After c:\test folder has created then today.doc will copy to c:\test.
  2. Using && for conditional processing
    If you use this character second command will executed if first command are executed successfully. For example like this command cd c:\test && copy c:\document\office.doc c:\test so it's means copy command will executed if cd c:\test are executed successfully.
  3. Using || for conditional processing.
    Reversed with number 2, if you using this character so second command will executed if first command are failed to executed. For example cd c:\test || md c:\test as it seen if cd c:\test command is fail and then md c:\test will executed.
  4. Just for addition, you can also sets the command to grouped with parenthess, for example (command1 & command2) && command3 and it's means command3 will executed if command 1 and command 2 are executed successfully. Otherwise, you can also make it like this command1 || (command2 & command3), in this case command 2 & command 3 will executed if command1 does not execute successfully.
That's it, and I am thinking what I will write on part-3 hehehe, I hope I can continue it.....

MS DOS commands part 1

Posted by EdSto | 8:28 PM | | 0 comments »

I remember when I learn computer for first time. Operating system that I used was Windows 3.11, yup that's an 'ancient' operating system for a lot of us but from it I learn so much about computer. From MS DOS, WordStar for DOS, Lotus 123 and the others. And one of them that still I like and remember is MSDOS commands. I still use DOS commands until today on Windows XP and Vista. Because I feel I still get the speed and customizing ability with its parameter from the commands.
And I want share my favourite MSDOS commands that had been helping me for almost 14 years !
I type it in unsorted because I type it when I remember it but hopefully, you get benefit from my this article.

  1. dir, I am ensuring that you will type this command at your prompt :) for 50% ratio from all your typed commands. This command is very easy; type dir /ah to browse the hidden files; dir /ad to browse folder only; dir *.exe to browse all executable files; dir *how*.exe to browse all files that having part name "how" like howdy, howto, etc; dir *.xl? to browse all files that have extension xl something, like xls, xlk, ....
  2. copy, this command to copy file from one folder to another folder. For examples, if you want copy test1.doc file to c:\test folder type : copy test1.doc c:\test; your can also rename/change file name to do that type : copy test1.doc test2.doc, so you have the same files but have different file name. For additional only you can also make a file with this command, type copy con (filename) and then press Enter key and then begin to type your test and if you has finished press Ctrl-Z key and your files will created, for example type copy con autoexec.bat.
  3. cd, this command to change your current directory (we call it folder now) to use it : just type cd , for example if you want change your directory to c:\test just type cd c:\test and if you has in test directory and want to enter the sub directory just type cd like cd test_1.
  4. ren, if you want to rename a file, use this command. Type ren test1.doc test2.doc to rename test1.doc to test2.doc.
  5. del, yup this command to delete a file or collection file, if you want delete test1.doc file type del test1.doc and if you want delete entire file in your current folder just type del *.*; if you want delete certain extension file type del *.exe.
  6. attrib, this command to change current attribut file to another attribute and display file attributes, as you know that there are several attributes available like hidden, system, archive, read-only, so if you want to know the attribute from test1.doc attributes just type attrib test1.doc so you can see its attributes from the result, and if you want change hidden attribute from file test1.doc, type attrib -h test1.doc and if you want change all files attributes in your current directory just type attrib -h *.* so all your files that in your current directory will changed.
  7. mkdir, this command to make a folder/directory, to use it type mkdir test_1 if you want to make test_1 folder.
  8. deltree, this command to delete/remove a folder/directory, if you type deltree test so your test folder will deleted.
  9. cls, if your screeen has crowd and confused just type cls to clear your screen.
  10. type, to view a file content, for example if you want to know the content of test1.doc file, type type test1.doc and the test1.doc content will displayed.
  11. label, this command has function to changel you harddrive label, to use it just type label and then press Enter and then type new label for your harddrive when your asked or your can also type like this label c: new_label (change new_label with your own label).
  12. date, this command to change your current computer date, to use it just type date then press Enter key and then type new date when you asked.
  13. time, this command to change your current computer time, to use it just type time then press Enter key and then type new time when you asked.
  14. chkdsk, this command to repair your harddrive, to use it type chkdsk c: to repair c: drive and if your want to fix it add f parameter so you type chkdsk /f c:.
To open your command prompt/shell environment, click Start - Run menu and type cmd in texbox then press Enter key. OK I am very sleepy now and I will continue to write the part 2. I hope my article give some benefit for you......