Loading ...
Sorry, an error occurred while loading the content.
 

Won't write a log file

Expand Messages
  • Gary Kuznitz
    I can t figure out why this batch file won t write any log. @echo off cls set SUFFIX=0 ... set /A SUFFIX=SUFFIX + 1 set FILENAME=DirMS%SUFFIX%.log if exist
    Message 1 of 3 , Jan 22, 2009
      I can't figure out why this batch file won't write any log.

      @echo off
      cls
      set SUFFIX=0
      :Defrag
      set /A SUFFIX=SUFFIX + 1
      set FILENAME=DirMS%SUFFIX%.log
      if exist %FILENAME% del %FILENAME% > NUL

      call "C:\Program Files\DefragDirMS\DirMS.exe" c: defrag -q -o "C:\Program
      Files\DefragDirMS\%FILENAME% -a "C:\Program Files\DefragDirMS\%FILENAME%
      call "C:\Program Files\DefragDirMS\DirMS.exe" c: move lcn -o "C:\Program
      Files\DefragDirMS\%FILENAME% -a "C:\Program Files\DefragDirMS\%FILENAME%
      call "C:\Program Files\DefragDirMS\DirMS.exe" c: compact -q -o "C:\Program
      Files\DefragDirMS\%FILENAME% -a "C:\Program Files\DefragDirMS\%FILENAME%
      GOTO Defrag

      (If the line starts in col one the line wrapped)

      It isn't creating any file at all. It should creeate a log.

      Thank you,

      Gary Kuznitz
    • Gary Kuznitz
      I found my answer but I have another question. ... I found I was missing quotes: call C: Program Files DefragDirMS DirMS.exe c: compact -q -o C: Program
      Message 2 of 3 , Jan 22, 2009
        I found my answer but I have another question.

        On 22 Jan 2009 at 7:15, Gary (Gary Kuznitz <batchworld@yahoogroups.com>) commented about [BATCH WORLD] Won't write a log file:

        > I can't figure out why this batch file won't write any log.
        >
        > @echo off
        > cls
        > set SUFFIX=0
        > :Defrag
        > set /A SUFFIX=SUFFIX + 1
        > set FILENAME=DirMS%SUFFIX%.log
        > if exist %FILENAME% del %FILENAME% > NUL
        >
        > call "C:\Program Files\DefragDirMS\DirMS.exe" c: defrag -q -o "C:\Program
        > Files\DefragDirMS\%FILENAME% -a "C:\Program Files\DefragDirMS\%FILENAME%
        > call "C:\Program Files\DefragDirMS\DirMS.exe" c: move lcn -o "C:\Program
        > Files\DefragDirMS\%FILENAME% -a "C:\Program Files\DefragDirMS\%FILENAME%
        > call "C:\Program Files\DefragDirMS\DirMS.exe" c: compact -q -o "C:\Program
        > Files\DefragDirMS\%FILENAME% -a "C:\Program Files\DefragDirMS\%FILENAME%
        > GOTO Defrag
        >
        > (If the line starts in col one the line wrapped)
        >
        I found I was missing quotes:
        call "C:\Program Files\DefragDirMS\DirMS.exe" c: compact -q -o "C:\Program
        Files\DefragDirMS\%FILENAME%" -a "C:\Program Files\DefragDirMS\%FILENAME%"

        This produces a log file with a sequence number starting with:
        DirMS1.log

        I'd like to find out how to make the sequence number 3 characters?
        DirMS001.log
        > Thank you,
        >
        > Gary Kuznitz
      • foxidrive
        On Thu, 22 Jan 2009 08:52:54 -0800, Gary Kuznitz ... Untested: set /A SUFFIX=SUFFIX + 1 set num= %suffix% set num=%num:~-3% set
        Message 3 of 3 , Jan 22, 2009
          On Thu, 22 Jan 2009 08:52:54 -0800, "Gary Kuznitz" <docfxit@...>
          wrote:

          >> @echo off
          >> cls
          >> set SUFFIX=0
          >> :Defrag
          >> set /A SUFFIX=SUFFIX + 1
          >> set FILENAME=DirMS%SUFFIX%.log
          >> if exist %FILENAME% del %FILENAME% > NUL

          > call "C:\Program Files\DefragDirMS\DirMS.exe" c: compact -q -o "C:\Program
          >Files\DefragDirMS\%FILENAME%" -a "C:\Program Files\DefragDirMS\%FILENAME%"
          >
          >This produces a log file with a sequence number starting with:
          >DirMS1.log
          >
          >I'd like to find out how to make the sequence number 3 characters?
          >DirMS001.log

          Untested:

          set /A SUFFIX=SUFFIX + 1
          set num= %suffix%
          set num=%num:~-3%
          set FILENAME=DirMS%num%.log
        Your message has been successfully submitted and would be delivered to recipients shortly.