JSI Tip 6455. NOW.EXE causes strange behavior?

When you use NOW.EXE from the free download, or from the The Windows 2000 Server Resource Kit or Supplement One, and pipe the output to a file, the file may not be released quickly enough and this behavior may cause intermittent problems with other programs and commands in your script.

To workaround this problem:

1. Copy / Paste the following to a NOW.BAT file and store it in a folder that is before the Resource Kit in your path:

@echo off
if \{%1\}

\{\} goto :END set msg=%1 :Loop shift if \{%1\}

\{\} goto :END set msg=%msg% %1 goto loop :END now.exe %msg% sleep 1 endlocal
2. If you used NOW, as apposed to NOW.EXE, in your scripts, such as now log this>>filename.log, you will NOT have to change any of your scripts.

NOTE If you don't have Sleep.exe, use @ping -n 2>nul or @ping -n 1>nul.

NOTE: You can use this technique of creating a ProgramName.BAT file to alter the functionality of any ProgramName.EXE.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.