Toon posts:

[Win98]Defrag automatisch starten

Pagina: 1
Acties:

Verwijderd

Topicstarter
Een vriend van mij heeft win98se, nu wil hij dat elke vrijdag defrag wordt gestart om 11 uur savonds. Ik heb dit met taakplanner ingesteld, maar dan moet je nog dingen autmatisch doen, namelijk schijfcontrole en schijf selecteren. Kan dit ook automatisch?

Verwijderd

Verwijderd schreef op 30 maart 2004 @ 15:10:
Een vriend van mij heeft win98se, nu wil hij dat elke vrijdag defrag wordt gestart om 11 uur savonds. Ik heb dit met taakplanner ingesteld, maar dan moet je nog dingen autmatisch doen, namelijk schijfcontrole en schijf selecteren. Kan dit ook automatisch?
Het antwoord is NEE :)

Je hebt wel andere programma's die dat automtisch doen, maar dat programma van Windows kan zoiets niet.
Ik weet zelf niet welke programma's daarvoor zijn 8)7 . Misschien eens rondzoeken bij download.com :)

  • alt-92
  • Registratie: Maart 2000
  • Niet online

alt-92

ye olde farte

Je kan eventueel naar een stukkie Windows Shell scripting / VBscript kijken die voor jou de handelingen verricht.

Dit is er een voor de defrag.msc snapin op 2000/XP, maar als je ziet wat het script doet wordt het wel duidelijker.

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
'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 second
WshShell.Run "dfrg.msc"
WScript.Sleep 1000

'Wait until the application has loaded - Check every second
While WshShell.AppActivate("Schijfdefragmentatie") = FALSE
    wscript.sleep 1000
Wend

'Bring the application to the foreground
WshShell.AppActivate "Schijfdefragmentatie"
WScript.Sleep 200

'Send an ALT-A key to bring down the defrag menu
WshShell.SendKeys "%A"
WScript.Sleep 200

'Send a D to start the defrag
WshShell.SendKeys "D"

'Wait until the defrag is completed - Check for window every 5 seconds
While WshShell.AppActivate("Defragmentatie is voltooid") = FALSE
    wscript.sleep 5000
Wend

'Bring the msgbox to the foreground
WshShell.AppActivate "Defragmentatie is voltooid"
WScript.Sleep 200

'Send a tab key to move the focus from View Report button to the Close Button
WshShell.Sendkeys "{TAB}"
Wscript.Sleep 500

'Send key to Close the Defragmentation Complete window
WshShell.Sendkeys "{ENTER}"
Wscript.Sleep 500

'Send a tab key to move the focus onto disks again
WshShell.Sendkeys "{TAB}"
Wscript.Sleep 500

'Send a down arrow key to move the focus from C to D
WshShell.Sendkeys "{DOWN}"
Wscript.Sleep 500

'Send an ALT-A key to bring down the defrag menu
WshShell.SendKeys "%A"
WScript.Sleep 200

'Send a D to start the defrag
WshShell.SendKeys "D"

'Wait until the defrag is completed - Check for window every 5 seconds
While WshShell.AppActivate("Defragmentatie is voltooid") = FALSE
    wscript.sleep 5000
Wend

'Bring the msgbox to the foreground
WshShell.AppActivate "Defragmentatie is voltooid"
WScript.Sleep 200

'Send a tab key to move the focus from View Report button to the Close Button
WshShell.Sendkeys "{TAB}"
Wscript.Sleep 500

'Send key to Close the Defragmentation Complete window
WshShell.Sendkeys "{ENTER}"
Wscript.Sleep 500

'Send a tab key to move the focus onto disks again
WshShell.Sendkeys "{TAB}"
 'Wscript.Sleep 500

'Send a down arrow key to move the focus from D to E
'WshShell.Sendkeys "{DOWN}"
'Wscript.Sleep 500

'Send an ALT-A key to bring down the defrag menu
WshShell.SendKeys "%A"
WScript.Sleep 200

'Send a D to start the defrag
WshShell.SendKeys "D"

'Wait until the defrag is completed - Check for window every 5 seconds
While WshShell.AppActivate("Defragmentatie is voltooid") = FALSE
    wscript.sleep 5000
Wend

'Bring the msgbox to the foreground
WshShell.AppActivate "Defragmentatie is voltooid"
WScript.Sleep 200

'Send a tab key to move the focus from View Report button to the Close Button
WshShell.Sendkeys "{TAB}"
Wscript.Sleep 500

'Send key to Close the Defragmentation Complete window
WshShell.Sendkeys "{ENTER}"
'Wscript.Sleep 500

'Send and ALT-F4 to Close the Defrag program
'WshShell.Sendkeys "%{F4}"



Enige kanttekening is dat je ingelogd moet zijn, maar met 98 moet dat toch niet echt een probleem zijn ;)

[ Voor 9% gewijzigd door alt-92 op 30-03-2004 16:50 ]

ik heb een 864 GB floppydrive! - certified prutser - the social skills of a thermonuclear device


Verwijderd

Kon je dat ook niet gewoon instellen in Taakplanner? :/