Scheduled disk detection in Windows 2000/XP

Source: Internet
Author: User

The pre-disconnection time was written into the XP environment of the Plan disk fragment: http://blog.csdn.net/scz123/archive/2005/07/05/414417.aspx. At that time, I was wondering if I could perform disk detection?

You can use the chkdsk. EXE command to perform disk detection. However, some disk commands may prompt you when checking some disk commands, and the plan may be faulty.

D:/> chkdsk D:/R/x
The file system type is NTFS.
The current drive cannot be locked.

The chkdsk cannot be run because another process is using this volume.
Are you planning to check this volume the next time the system restarts? (Y/N)

The cursor stops there, unless you manually enter it, which is of course not in line with the automation of the plan.

When I learned about Linux yesterday, I used the input and output redirection: symbol> for the output redirection. Symbol <indicates the input direction. This output is often used in windows. Today, I tried the input redirection in Widnows, but I didn't expect it to work. Well, you don't have to laugh. You don't know it if you don't use it. It's not too late to know it now.

Therefore, a batch is written and used as a scheduled task call:

Checkdisk. bat

Echo y> ans.txt
Chkdsk D:/R/x <ans.txt
Del ans.txt/Q

You have run the following commands to achieve the expected results. You do not need to manually enter "Y:

D:/> echo y> ans.txt

D:/> chkdsk D:/R/x <ans.txt
The file system type is NTFS.
The current drive cannot be locked.

The chkdsk cannot be run because another process is using this volume.
Are you planning to check this volume the next time the system restarts? (Y/N)
The volume will be checked the next time the system restarts.

D:/> Del ans.txt/Q

D:/>

Therefore, there is no problem with pulling the scheduled task. Of course, if the volume is being used, the disk detection can only be solved by restarting. As for how to set a scheduled task, I will not talk about it more here.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.