That's the limitation of the built in defrag cmdlet; you can's schedule it.
You might need to but the full version. BTW: why are you doing this( the
defrag that is)?
"twiggo" <> wrote in message
news:...
>
> thanks RemyMaza & Lanwench
>
> How can I insert those lines of codes you pasted?
>
> At this point I think....
>
> 'Create the Error Report in the root of the first fixed disk.
> Set MyFile = fso.OpenTextFile(Drive & "\defragreport.txt", 2, True)
> MyFile.WriteLine(Date) & vbCRLF
> MyFile.WriteLine(Time) & vbCRLF
> For I = 1 to X
> MyFile.WriteLine(ErrStr(I))
> Next
> MyFile.Close
>
> Return = WshShell.Run(Drive & "\defragreport.txt",3,True)
>
> Set WshShell = Nothing
> Set fso = Nothing
>
>
> Could you make an example? And...are you sure working with UNC name
> with command shell?
>
> And...
>
> Last but not the least...I need to shedule it (with non administrative
> privilege)
>
> Thanks!
>
>
> --
> twiggo
> ------------------------------------------------------------------------
> twiggo's Profile: http://forums.techarena.in/members/twiggo.htm
> View this thread: http://forums.techarena.in/server-scripting/1141820.htm
>
> http://forums.techarena.in
>