No,
you must be logged on for it to run. But you can lock the
workstation
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Morgan, Joshua
Sent: Friday, May 10, 2002 6:09 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [ActiveDir] Automating DefragmentationIf I schedule it using the Task Scheduler... Will it run correctly with the machine logged off?
Joshua Morgan
PH: (864) 250-1350 Ext 133
[EMAIL PROTECTED]
http://www.profit-lab.com
http://ncontrol.info-----Original Message-----
From: Bryon Barkley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 09, 2002 10:25 PM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] Automating DefragmentationCan't go wrong with this, I use it every day.-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Ayers, Diane
Sent: Thursday, May 09, 2002 1:32 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [ActiveDir] Automating DefragmentationAnother Option for scheduling a defrag.Diane-----Original Message-----This is what I use in VBScript.
From: David Lee [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 07, 2002 2:15 PM
To: [EMAIL PROTECTED]
Subject: Re: [ActiveDir] Automating Defragmentation
'This script launches defrag and sends keys to the UI in order to automate the defrag
'process.set WshShell = CreateObject("WScript.Shell")
'Launch Defrag from the command line and wait for a secondWshShell.Run "dfrg.msc" WScript.Sleep 1000
'Wait until the application has loaded - Check every secondWhile WshShell.AppActivate("Disk Defragmenter") = FALSE wscript.sleep 1000 Wend
'Bring the application to the foregroundWshShell.AppActivate "Disk Defragmenter" WScript.Sleep 200
'Send an ALT-A key to bring down the degrag menuWshShell.SendKeys "%A" WScript.Sleep 200
'Send a D to start the defragWshShell.SendKeys "D"
'Wait until the defrag is completed - Check for window every 5 secondsWhile WshShell.AppActivate("Defragmentation Complete") = FALSE wscript.sleep 5000 Wend
'Bring the msgbox to the foregroundWshShell.AppActivate "Defragmentation Complete" WScript.Sleep 200
'Send a tab key to move the focus from View Report button to the Close ButtonWshShell.Sendkeys "{TAB}" Wscript.Sleep 500
'Send key to Close the Defragmentation Complete windowWshShell.Sendkeys "{ENTER}" Wscript.Sleep 500 WshShell.Sendkeys "{TAB}" Wscript.Sleep 500 wshshell.Sendkeys "{down}" Wscript.Sleep 500
'Send an ALT-A key to bring down the degrag menuWshShell.SendKeys "%A" WScript.Sleep 200
'Send a D to start the defragWshShell.SendKeys "D"
'Wait until the defrag is completed - Check for window every 5 secondsWhile WshShell.AppActivate("Defragmentation Complete") = FALSE wscript.sleep 5000 Wend
'Bring the msgbox to the foregroundWshShell.AppActivate "Defragmentation Complete" WScript.Sleep 200
'Send a tab key to move the focus from View Report button to the Close ButtonWshShell.Sendkeys "{TAB}" Wscript.Sleep 500
'Send key to Close the Defragmentation Complete windowWshShell.Sendkeys "{ENTER}" Wscript.Sleep 500 'WshShell.Sendkeys "{TAB}" 'Wscript.Sleep 500 wshshell.Sendkeys "{down}" Wscript.Sleep 500
'Send an ALT-A key to bring down the degrag menuWshShell.SendKeys "%A" WScript.Sleep 200
'Send a D to start the defragWshShell.SendKeys "D"
'Wait until the defrag is completed - Check for window every 5 secondsWhile WshShell.AppActivate("Defragmentation Complete") = FALSE wscript.sleep 5000 Wend
'Bring the msgbox to the foregroundWshShell.AppActivate "Defragmentation Complete" WScript.Sleep 200
'Send a tab key to move the focus from View Report button to the Close ButtonWshShell.Sendkeys "{TAB}" Wscript.Sleep 500
'Send key to Close the Defragmentation Complete windowWshShell.Sendkeys "{ENTER}" Wscript.Sleep 500
'Send and ALT-F4 to Close the Defrag programWshShell.Sendkeys "%{F4}"
At 04:04 PM 5/7/2002 -0400, you wrote:
Does any have a script or a source they can point me to help me Automate
Windows 2000's Defrag utility
Joshua Morgan
PROFITLAB
Senior Network Engineer
PH: (864) 250-1350 Ext 133
Fax: (413) 581-4936
[EMAIL PROTECTED]
http://www.profit-lab.com
http://ncontrol.info
The greatest glory is not in never failing, but in rising up every time we
fall.
-- Confucius
List info : http://www.activedir.org/mail_list.htm
List FAQ : http://www.activedir.org/list_faq.htm
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/David D. Lee
Computer Resource Specialist II
Office of Undergraduate Admissions
[EMAIL PROTECTED]
2-6417
