Ethernet adapter interfering with Mouse
*** See below.
wrote in message
...
Here is the experimental script that I used. I basically just moved
the ping to the beginning of the subroutine, as a test to see if the
"call" command would block or not. According to the documentation,
the script is supposed to continue executing without waiting for the
call command to finish
*** I do not know what documentation you refer to but whatever
*** it is, it is incorrect. The ping command I used will cause the
*** batch file to pause unconditionally.
so that means we should see the "Entering Sub"
line printed out twice immediately. But when I run it, I see
"Entering Sub", followed by a 9 second pause, followed by "Exiting
Sub" and then "Entering Sub", followed by a 9 second pause and then
"Exiting Sub".
*** This is exactly what I expected.
So based on that behavior, it would seem that the ping
command isn't necessary at all in the script.
*** I introduced the ping command because I did not know
*** whether you needed to keep your NIC off for a few
*** seconds. I alluded to this in my second response. The
*** interrupt problem you report is fairly bizarre, hence
*** the work-around may need to do some bizarre things too . . .
It seems to work fine without it.
*** Great!
But now I'm confused about when the call command is
blocking and when it is non-blocking.
*** The subroutine disables the NIC when invoked with a "disable"
*** parameter and vice versa. Furthermore it tells you what it does
*** when you invoke it from a Command Prompt or if you add
*** a Pause command like so:
call :Sub disable
call :Sub enable
pause
goto :eof
*** or perhaps like so:
call :Sub disable
call :Sub enable
ping localhost -n 5 nul
goto :eof
|