vista磁盘使用100%
It’s always a good idea to run regular maintenance tasks like Disk Cleanup on your Windows machine to help keep it running smoothly. Today we take a look at how to schedule a basic Disk Cleanup task, and how to use command line switches for a more advanced setup.
在Windows计算机上运行常规维护任务(如磁盘清理)总是一个好主意,以帮助使其平稳运行。 今天,我们来看看如何安排基本的磁盘清理任务,以及如何使用命令行开关进行更高级的设置。
Schedule Disk Cleanup Basic
计划磁盘清理基本
Windows includes some handy tools to help keep your machine operating smoothly. One such tool is Disk Cleanup that can remove temp and old files to help you reclaim some hard drive space. You might want to set it up to run weekly or monthly depending on what works best for you. To schedule Disk Cleanup to run on a regular basis we need to schedule a task. For this example we’re using Windows 7, but the steps are essentially the same in Vista as well.
Windows包含一些方便的工具,可帮助您保持机器的平稳运行。 磁盘清理就是其中一种,它可以删除临时文件和旧文件,以帮助您回收一些硬盘空间。 您可能希望将其设置为每周或每月运行,这取决于最适合您的情况。 要安排磁盘清理定期运行,我们需要安排任务。 对于此示例,我们使用Windows 7,但步骤在Vista中也基本相同。
Click on the Start Menu and enter task scheduler into the search box and hit Enter.
单击开始菜单,然后在搜索框中输入任务计划程序 ,然后按Enter。
The Task Scheduler opens and you’ll want to click on Action then select Create Basic Task.
将打开“任务计划程序”,然后单击“操作”,然后选择“ 创建基本任务” 。
The Create Basic Task Wizard comes up and from here type in a name for the task and a description then click Next.
出现“创建基本任务向导”,并从此处输入任务名称和描述,然后单击“下一步”。
Now select how often you want Disk Cleanup to run…Weekly, Daily, Monthly, One Time…etc. There is not right or wrong answer to how often you run it. It’s completely up to you and you might want to try out some different schedules. In this example we’re going to select weekly.
现在,选择您希望磁盘清理运行的频率…每周,每天,每月,一次…等等。 您运行它的频率没有正确或错误的答案。 这完全取决于您,您可能想尝试一些不同的时间表。 在此示例中,我们将选择每周一次。
Since we set it up to run weekly we need to schedule it when to start, how often it reoccurs, and which day of the week to run it.
由于我们将其设置为每周运行,因此我们需要安排它的启动时间,重新出现的频率以及每周的哪一天运行。
Next under Action select Start a program…
接下来在“操作”下选择“ 启动程序 ...”。
In the Program/script field type in cleanmgr.exe
在“程序/脚本”字段中,输入cleanmgr.exe
Or you can hit browse and select Disk Cleanup which is in C:\Windows|system32\cleanmgr.exe
或者,您可以点击浏览并选择C:\ Windows | system32 \ cleanmgr.exe中的“磁盘清理”
Under Program/script you’ll see the path to Disk Cleanup as C:\Windows\system32\cleanmgr.exe
在“程序/脚本”下,您将看到磁盘清理的路径为C:\ Windows \ system32 \ cleanmgr.exe
Then you’re shown a summary of the scheduled task and if everything looks correct click on Finish.
然后,您将看到计划任务的摘要,如果一切看起来正确,请单击“完成”。
For this basic setting we scheduled it for a time when we know the computer will be in use. When it’s time for the Scheduled Task to occur it will pop up and you can run it by selecting the drive to clean up.
对于此基本设置,我们将其安排在知道计算机将要使用的时间。 当计划任务发生时,它将弹出,您可以通过选择要清理的驱动器来运行它。
Disk Cleanup starts its calculations…
磁盘清理开始计算...
Now the results and you can choose the files to delete.
现在显示结果,您可以选择要删除的文件。
Advanced Command Line Switches
高级命令行开关
While the above method is effective, you may not want to interact with the Disk Cleanup utility at all. Running a couple of command line switches will allow you to select what to have cleaned up and run everything automatically. To open the Command Prompt type cmd into the search box in the Start Menu and hit Enter.
尽管上述方法有效,但您可能根本不想与“磁盘清理”实用程序进行交互。 运行几个命令行开关将使您能够选择要清除的内容并自动运行所有内容。 要打开命令提示符,请在开始菜单的搜索框中键入cmd ,然后按Enter。
With the Command Prompt open type in the following:
在命令提示符打开的情况下,输入以下内容:
cleanmgr.exe /sageset:1
cleanmgr.exe / sageset:1
That will open the Disk Cleanup Settings dialog box where you can select the items you want Disk Cleanup to delete. You’ll notice there are a lot more options here than when you go through the GUI to cleanup files.
这将打开“磁盘清理设置”对话框,您可以在其中选择要磁盘清理删除的项目。 您会发现这里比通过GUI清理文件的选项更多。
After selecting the files you want to be deleted in Disk Cleanup Settings click Ok to close out of the screen. The /sageset:1 command creates a registry key that saves the settings you entered.
在“磁盘清理设置”中选择要删除的文件后,单击“确定”关闭屏幕。 / sageset:1命令创建一个注册表项,用于保存您输入的设置。
Now go in and create your Scheduled Task like we showed previously, but this time you’ll want to add in /sagerun:1 into the Add argument field.
现在进入创建计划任务的过程,就像我们之前显示的那样,但是这次您要在/ sagerun:1中添加到Add参数字段。
Now when Disk Cleanup runs it’ll retrieve those saved settings you created with /sageset:1 and you won’t need to interact with Disk Cleanup at all. It will run automatically and clean up the files you selected in Disk cleanup Settings.
现在,当磁盘清理运行时,它将检索您使用/ sageset:1创建的那些保存的设置,而您根本不需要与磁盘清理进行交互。 它会自动运行并清理您在“磁盘清理设置”中选择的文件。
Task Scheduler Error
任务计划程序错误
When you launch Task Manager in Windows 7 you might get the following error message. It tells you to hit refresh but the error keeps coming back. It doesn’t seem to negatively affect anything you schedule, but it’s quite annoying.
在Windows 7中启动任务管理器时,您可能会收到以下错误消息。 它告诉您单击刷新,但错误不断返回。 它似乎并没有对您安排的任何事情产生负面影响,但是很烦人。
From the research I’ve done on this error, there are a handful of different solutions that have worked for different people. On our system, the Disk Defrag Schedule was turned off, so we turned it back on and resolved the issue. On a separate Windows 7 system the Disk Defrag Schedule was already on (which it is by default) and turning it off cured the error. On another machine I had to turn it off then back on to fix the error message.
根据我对这个错误所做的研究,有很多针对不同人的不同解决方案。 在我们的系统上,磁盘碎片整理计划已关闭,因此我们将其重新打开并解决了该问题。 在单独的Windows 7系统上,“磁盘碎片整理计划”已打开(默认情况下),将其关闭可以解决该错误。 在另一台计算机上,我必须将其关闭然后重新打开以修复错误消息。
Since this “rub your head and pat your belly” approach worked we didn’t try any other possible fixes. If you find it doesn’t work or have found another solution let us know in the comments.
由于这种“擦头并拍腹部”的方法有效,因此我们没有尝试任何其他可能的修复方法。 如果您发现它不起作用或找到其他解决方案,请在评论中告知我们。
Conclusion
结论
If you use the advanced switches to run Disk Cleanup it actually offers a lot more choices. In the /sageset:1 switch, “1” is just an arbitrary number. You can enter any number you want, but make sure /sagerun:”x” corresponds to the number you used in /sageset:”x”. So you can customize the switches for different types of files you want to clean in Disk Cleanup Settings.
如果使用高级开关运行“磁盘清理”,则实际上提供了更多选择。 在/ sageset:1开关中,“ 1”只是一个任意数字。 您可以输入所需的任何数字,但请确保/ sagerun:“ x”对应于/ sageset:“ x”中使用的数字。 因此,您可以在“磁盘清理设置”中为要清除的不同类型的文件自定义开关。
For example, maybe you only want to clean Temp Internet files during a cleanup session, then you could do /sageset:1 and /sagerun:1 for that. Then if you want to clean up all files you could use /sageset:10 and /sagerun:10 for that. The switches give you more flexibility in the types of files that are deleted during the Disk Cleanup session. Whichever method you use, or if you just want to run it manually, running Disk Cleanup will keep your drive free of unwanted files.
例如,也许您只想在清理会话期间清理Temp Internet文件,则可以为此执行/ sageset:1和/ sagerun:1。 然后,如果要清理所有文件,则可以使用/ sageset:10和/ sagerun:10。 这些开关为您在磁盘清理会话期间删除的文件类型提供了更大的灵活性。 无论使用哪种方法,或者只想手动运行它,运行“磁盘清理”都会使驱动器中没有不需要的文件。
翻译自: https://www.howtogeek.com/howto/10705/how-to-schedule-disk-cleanup-in-windows-7-vista/
vista磁盘使用100%