JSI Tip 6455. NOW.EXE causes strange behavior?

Jerold Schulman

March 20, 2003

1 Min Read
ITPro Today logo in a gray background | ITPro Today


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 offsetlocalif {%1}
{} goto :ENDset msg=%1:Loopshift if {%1}
{} goto :ENDset msg=%msg% %1goto loop:ENDnow.exe %msg%sleep 1endlocal

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 127.0.0.1>nul or @ping -n 1 127.0.0.1>nul.

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



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like