-----------------------------------------------------------------------------

AutoIt

Q #1: How do I format a bootable system diskette from within AutoIt?

      ---------------------------------------------------------------------

A #1: In Windows 9x you can do the following:

      ; ======= Scriptlet Starts Here =======
      GoSub, MakeTmp
      FileAppend, Y\nN\n, %TMPFILE%
      RunWait, %COMSPEC% /c FORMAT.COM A: /S /U <%TMPFILE%
      RunWait, %COMSPEC% /c del %TMPFILE%
      Exit

      MakeTmp:
            SetBatchLines, 1000
            Random, T, 1, 32767
            SetEnv, TmpFile, C:\\%T%.txt
            SetEnv, TMPFILE, C:\\%T%.txt
            IfExist, %TmpFile%, GoSub, MakeTmp
            FileAppend, ,%TmpFile%
            Sleep, 1000
            Send, ^Z
            IfExist, %TMPFILE%, Goto, MakeTmp_END
            SetEnv, ERRORLEVEL, 1
            MakeTmp_END:
            SetBatchLines, 1
      Return
      ; ======= Scriptlet Ends Here =======

-----------------------------------------------------------------------------

Q #2: How can I defrag my hard drive on a nightly basis using a W2K
      scheduler?  Does anyone know how to run the dfrg.msc executable
      in a script?

      ---------------------------------------------------------------------

A #1: I use O&O's FreeWare Defragmenter for Win2k.  Unfortunately, I
      removed the MS Defrag when I installed the freeware version.
      However, the following command in an AutoIt script allowed me to
      bring up the O&O Defrag program from an AutoIt script.  Note: The O&O
      Defrag may not have command line parameters you can pass in, though
      MS's Defrag might.

      Run, C:\\WINNT\\system32\\mmc.exe  "C:\\Program Files\\OOD2KFRE\\OOD2KFRE.MSC" /s