aGerman wrote:I don't find the same effect. My output:
Unfortunately I'm unable to reproduce your effect.
Regards
aGerman
Many thanks for your patience, efforts, and your test code that used Subst.
I have adapted your code and in 1 second it performs 4 cycles of reading and displaying the version string of each executable held in two different folders.
I find that it does a perfect job in about 130 mSec most of the time, but at 33 second intervals it takes 2410 to 2450 mSec.
I am now more than satisfied that I am always given the correct answers, it is just "bad luck" that I sometimes have to wait longer than normal.
I now find I can avoid these 2+ second delays by unplugging the Ethernet cable to the Internet Router.
With the router disconnected it makes no difference if the Comodo Firewall is fully Disabled or Block-All,
either way no problem so long as Comodo Defense+ and Anti-Virus are fully disabled.
If however Defense+ is set to Safe mode then Comodo causes very frequent intervals each exceeding 1 second.
Till now when doing any "serious" operations such as partition management under Live Windows, Defragging, etc.;
I have always switched the Comodo configuration of A.V., Defense+, and Firewall each from normal protection levels,
setting Firewall to Block-All, and A.V., Defense+ to disabled, and nothing bad happened, and Comodo took no action.
I strongly suspect that Cscript is trying to send messages out to the Internet whilst it runs,
and the Comodo Firewall takes no action when Ethernet is unplugged,
but when the Ethernet is connected then Comodo plugs the hole,
or could it be some sort of Plug-n-Play where Windows is looking every 33 seconds for an Internet Play Mate ?
Either way I now know that Cscript is giving perfect answers regardless of 2+ seconds of occasional standstill,
so I can now perform long overdue investigations,
and look at Cscript/Internet/Firewall interactions later on.
I used two different versions of AutoRuns.exe to give me different version strings, not having a hex editor to hand.
They have versions 9.21.0.0 and 9.57.0.0
This is the start of my code output to Version.txt, showing the first use of Cscript suffers a delay of 2450 mSec
Code: Select all
9997 1 9:52:55.43
0 099 9:52:55.43 " Initial timing":- TOOK 9:52:55.43 - 9:52:55.43 = 00 mSec
245 100 9:52:57.88 9.21.0.0 "Delay timing":- TOOK 9:52:57.88 - 9:52:55.43 = 2450 mSec
12 101 9:52:58.02 9.57.0.0 "Delay timing":- TOOK 9:52:58.00 - 9:52:57.88 = 120 mSec
14 102 9:52:58.14 9.21.0.0 "Delay timing":- TOOK 9:52:58.14 - 9:52:58.00 = 140 mSec
13 103 9:52:58.27 9.57.0.0 "Delay timing":- TOOK 9:52:58.27 - 9:52:58.14 = 130 mSec
12 104 9:52:58.39 9.21.0.0 "Delay timing":- TOOK 9:52:58.39 - 9:52:58.27 = 120 mSec
After sorting in reverse order to Version.lst
Code: Select all
9999 SUMMARY RESULT Total Test Duration:- 9:55:01.43 - 9:52:55.43 = 126000 mSec
9998 2 9:55:01.43
9997 1 9:52:55.43
245 100 9:52:57.88 9.21.0.0 "Delay timing":- TOOK 9:52:57.88 - 9:52:55.43 = 2450 mSec
243 506 9:54:02.55 9.21.0.0 "Delay timing":- TOOK 9:54:02.55 - 9:54:00.12 = 2430 mSec
242 303 9:53:30.18 9.57.0.0 "Delay timing":- TOOK 9:53:30.17 - 9:53:27.75 = 2420 mSec
241 714 9:54:34.81 9.21.0.0 "Delay timing":- TOOK 9:54:34.81 - 9:54:32.40 = 2410 mSec
21 587 9:54:14.10 9.57.0.0 "Delay timing":- TOOK 9:54:14.10 - 9:54:13.89 = 210 mSec
20 336 9:53:35.00 9.21.0.0 "Delay timing":- TOOK 9:53:35.00 - 9:53:34.80 = 200 mSec
CMD.EXE process spent more than 2 seconds extra at 9:52:57.88, 9:53:30.18, 9:54:02.55, and 9:54:34.81
Simultaneously another CMD.EXE process was running a BAT script that regularly pinged at 1050 mSec,
even during those 4 long pauses, e.g.
Code: Select all
132 TOOK 9:53:28.97 - 9:53:27.92 = 1050 mSec
133 TOOK 9:53:30.01 - 9:53:28.97 = 1040 mSec
134 TOOK 9:53:31.06 - 9:53:30.01 = 1050 mSec
135 TOOK 9:53:32.10 - 9:53:31.06 = 1040 mSec
136 TOOK 9:53:33.15 - 9:53:32.10 = 1050 mSec
137 TOOK 9:53:34.19 - 9:53:33.15 = 1040 mSec
138 TOOK 9:53:35.24 - 9:53:34.19 = 1050 mSec
139 TOOK 9:53:36.28 - 9:53:35.24 = 1040 mSec
So obviously there are plenty of spare CPU cycles available for use.
This is my Version.Bat
Code: Select all
@echo off &setlocal EnableDelayedExpansion
SET T0=%TIME%
echo 9997 1 %T0% > %~dpn0.txt
(
echo Set objFSO = CreateObject^("Scripting.FileSystemObject"^)
echo Set objShell = CreateObject^("Shell.Application"^)
echo Set objFolderItem = objShell.Namespace^(objFSO.GetParentFolderName^(WScript.Arguments^(0^)^)^).ParseName^(objFSO.GetFileName^(WScript.Arguments^(0^)^)^)
echo WScript.Echo objFolderItem.ExtendedProperty^("FileVersion"^) ^& ";" ^& objFolderItem.ExtendedProperty^("ProductVersion"^)
)>%~dpn0.vbs
set "filename=K:\autoruns.exe"
ECHO %T0% %TA% %TIME%
CALL :DURATION %T0% %TIME% 099 " Initial timing":-
for /l %%i in (100,1,900) do (call :showver & CALL :DURATION !TA! !TIME! %%i "Delay timing":- )
echo 9998 2 %TIME% >> %~dpn0.txt
SET Ver_F=
CALL :DURATION %T0% %TIME% 9996 "Total Delay Duration":
echo 9999 SUMMARY RESULT Total Test Duration:- %TA% - %T0% = %T2%0 mSec
echo 9999 SUMMARY RESULT Total Test Duration:- %TA% - %T0% = %T2%0 mSec >> %~dpn0.txt
SORT /R %~dpn0.txt /O %~dpn0.lst
del %~dpn0.vbs
pause
GOTO :EOF
:showver
IF "%N%" EQU "1" (SET N=2) ELSE SET N=1
subst K: D:\test\T%N%
for /f "tokens=1,2 delims=; eol=" %%a in ('cscript //nologo %~dpn0.vbs "%filename%"') do (SET Ver_F=%%a)
subst /d K:
GOTO :EOF
:DURATION %1 %2
SET TA=%2
FOR /F "tokens=1-4 delims=:." %%d in ("%1") do SET /A T1=%%d*360000+1%%e*6000+1%%f*100+1%%g-610100
FOR /F "tokens=1-4 delims=:." %%d in ("%2") do SET /A T2=%%d*360000+1%%e*6000+1%%f*100+1%%g-610100-%T1%
FOR %%o in (CON %~dpn0.txt) DO ECHO %T2% %3 %TIME% %Ver_F% %4 TOOK %2 - %1 = %T2%0 mSec >> %%o
Regards
Alan