View Full Version : Defrag


hooverd
11-13-2006, 08:22 PM
I have a command line that I am using to run Defrag from the Command window
on Win2K systems, however I need the results to create a text file on their C:
here is the command I am using.

@ECHO OFF
START "Defragmenting Hard Drive Before Shutting Down" /WAIT defrag.exe c: -f -
v

Any ideas how to make the text file happen?

Jerold Schulman
11-14-2006, 02:31 AM
On Mon, 13 Nov 2006 20:22:41 GMT, "hooverd" <u29052@uwe> wrote:

>I have a command line that I am using to run Defrag from the Command window
>on Win2K systems, however I need the results to create a text file on their C:
>here is the command I am using.
>
>@ECHO OFF
>START "Defragmenting Hard Drive Before Shutting Down" /WAIT defrag.exe c: -f -
>v
>
>Any ideas how to make the text file happen?

@echo On
if exist c:\defrag.log del /q /f C:\defrag.log
call :logit>>C:\defrag.log 2>>&1
goto :EOF
:logit
defrag.exe C: -f -v

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com

JCO
11-14-2006, 11:14 PM
You forgot to put EOF in the code. The goto wont go anywhere (I think).

:EOF

"Jerold Schulman" <Jerry@jsiinc.com> wrote in message
news:heail2pt3l5k65voim7o1r113d803fmjpd@4ax.com...
> On Mon, 13 Nov 2006 20:22:41 GMT, "hooverd" <u29052@uwe> wrote:
>
> >I have a command line that I am using to run Defrag from the Command
window
> >on Win2K systems, however I need the results to create a text file on
their C:
> >here is the command I am using.
> >
> >@ECHO OFF
> >START "Defragmenting Hard Drive Before Shutting Down" /WAIT defrag.exe
c: -f -
> >v
> >
> >Any ideas how to make the text file happen?
>
> @echo On
> if exist c:\defrag.log del /q /f C:\defrag.log
> call :logit>>C:\defrag.log 2>>&1
> goto :EOF
> :logit
> defrag.exe C: -f -v
>
> Jerold Schulman
> Windows Server MVP
> JSI, Inc.
> http://www.jsiinc.com
> http://www.jsifaq.com

Jerold Schulman
11-15-2006, 01:08 PM
Wrong. :EOF is built-in


On Tue, 14 Nov 2006 23:14:06 GMT, "JCO" <someone@somewhere.com> wrote:

>You forgot to put EOF in the code. The goto wont go anywhere (I think).
>
>:EOF
>
>"Jerold Schulman" <Jerry@jsiinc.com> wrote in message
>news:heail2pt3l5k65voim7o1r113d803fmjpd@4ax.com...
>> On Mon, 13 Nov 2006 20:22:41 GMT, "hooverd" <u29052@uwe> wrote:
>>
>> >I have a command line that I am using to run Defrag from the Command
>window
>> >on Win2K systems, however I need the results to create a text file on
>their C:
>> >here is the command I am using.
>> >
>> >@ECHO OFF
>> >START "Defragmenting Hard Drive Before Shutting Down" /WAIT defrag.exe
>c: -f -
>> >v
>> >
>> >Any ideas how to make the text file happen?
>>
>> @echo On
>> if exist c:\defrag.log del /q /f C:\defrag.log
>> call :logit>>C:\defrag.log 2>>&1
>> goto :EOF
>> :logit
>> defrag.exe C: -f -v
>>
>> Jerold Schulman
>> Windows Server MVP
>> JSI, Inc.
>> http://www.jsiinc.com
>> http://www.jsifaq.com
>

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com

JCO
11-17-2006, 04:32 PM
Learn something new everyday.
Thanks (and didn't mean to but-in)

"Jerold Schulman" <Jerry@jsiinc.com> wrote in message
news:0a4ml29fdaj4ebusobk7h0ggsr3bnoh821@4ax.com...
>
> Wrong. :EOF is built-in
>
>
> On Tue, 14 Nov 2006 23:14:06 GMT, "JCO" <someone@somewhere.com> wrote:
>
> >You forgot to put EOF in the code. The goto wont go anywhere (I think).
> >
> >:EOF
> >
> >"Jerold Schulman" <Jerry@jsiinc.com> wrote in message
> >news:heail2pt3l5k65voim7o1r113d803fmjpd@4ax.com...
> >> On Mon, 13 Nov 2006 20:22:41 GMT, "hooverd" <u29052@uwe> wrote:
> >>
> >> >I have a command line that I am using to run Defrag from the Command
> >window
> >> >on Win2K systems, however I need the results to create a text file on
> >their C:
> >> >here is the command I am using.
> >> >
> >> >@ECHO OFF
> >> >START "Defragmenting Hard Drive Before Shutting Down" /WAIT defrag.exe
> >c: -f -
> >> >v
> >> >
> >> >Any ideas how to make the text file happen?
> >>
> >> @echo On
> >> if exist c:\defrag.log del /q /f C:\defrag.log
> >> call :logit>>C:\defrag.log 2>>&1
> >> goto :EOF
> >> :logit
> >> defrag.exe C: -f -v
> >>
> >> Jerold Schulman
> >> Windows Server MVP
> >> JSI, Inc.
> >> http://www.jsiinc.com
> >> http://www.jsifaq.com
> >
>
> Jerold Schulman
> Windows Server MVP
> JSI, Inc.
> http://www.jsiinc.com
> http://www.jsifaq.com