Re: WinXP Disk Defragmenter Run By Task Manager
- From: Craig Schiller <cschiller1@xxxxxxxxxxxxx>
- Date: Mon, 15 May 2006 18:15:57 -0400
So --- I have chkdsk as a scheduled task. It just ran for the first time over the weekend (thanks only to the help of David Candy and others here who got me straightened out on passwords, but I digress). The scheduled task window indicates that it did indeed run. There is nothing in the status column to indicate it ran successfully. And in the last result column, there is "0x2". Which means what? It ran successfully and then got crossed up by a command line error?
Craig
Doug Knox MS-MVP wrote:
Exit codes are "results" codes that are returned to the OS by an application. They're generally a number. This number can often be tracked back to the descriptive text of the error, if you know where to look.
For Defrag, the exit codes are:
0 = Completed normally
1 = Cancelled Manually
2 = Command line error
3 = Unknown error
4 = Insufficient memory resources
5 = (Not currently used)
6 = Possible permissions issue (not an Administrator) or a required DLL could not be loaded.
7 = Insufficient Free Space to defrag.
For example, Return = WshShell.Run("defrag " & d & " -f", 1, TRUE), run in a VB Script will launch DEFRAG for the drive letter that is assigned to the variable "d". The TRUE statement tells it to wait for the exit code before continuing on. Return would represent the 0 thru 7 exit code from DEFRAG.
To see this in action, you can download a script that will defrag all fixed disks and generate a log file of the activity.
http://www.dougknox.com/utility/scripts_desc/defrag_all.htm
Download defrag_all2.vbs. VBS scripts can be opened and viewed in Notepad.
.
- Follow-Ups:
- Re: WinXP Disk Defragmenter Run By Task Manager
- From: Doug Knox MS-MVP
- Re: WinXP Disk Defragmenter Run By Task Manager
- References:
- Re: WinXP Disk Defragmenter Run By Task Manager
- From: Doug Knox MS-MVP
- Re: WinXP Disk Defragmenter Run By Task Manager
- From: Doug Knox MS-MVP
- Re: WinXP Disk Defragmenter Run By Task Manager
- Prev by Date: Re: System Prefs Don't Hold On Restart
- Next by Date: Re: How do you get ridof MyDocuments etc?
- Previous by thread: Re: WinXP Disk Defragmenter Run By Task Manager
- Next by thread: Re: WinXP Disk Defragmenter Run By Task Manager
- Index(es):
Relevant Pages
|