If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#31
|
|||
|
|||
Ethernet adapter interfering with Mouse
On Jul 20, 4:53*pm, "GTS" wrote:
wrote in message ... I have tried 2 different mice (a Logitech and a Microsoft) on my laptop running Windows XP Pro SP3, and both of them were jerky. *I finally traced the problem to the built-in ethernet adapter. *Once I go into the Device Manager and disable the Intel Pro/1000 PL network adapter, then the mouse will be smooth. *It will still be smooth even if I subsequently re-enable the network adapter. *But if I restart Windows with the network adapter enabled, then the mouse will be jerky again. Not sure what's going on here, maybe it's a resource issue. *I noticed that the network adapter is on IRQ 16, and one of the USB Universal Host Controllers is also on IRQ 16. *But Windows won't let me change any of the resource settings for the mouse or the network adapter. *I also tried a different USB port and still had the same problem. Any idea on how to fix this? If not, then is there a way to disable and enable devices from the command line? *I'll just have a script disable and re-enable the network adapter on startup. What is the make and model of laptop? *Have you checked whether there is an updated BIOS available? *Also, the manufacturers support site for any info (in case there's a known issue)? It is a Thinkpad T60. I did upgrade to the latest BIOS, and that did not help. I have posted about this problem to forums.lenovo.com and also forum.thinkpad.com, and no one seems to have heard of this problem. A google search about this problem also really doesn't turn up anything. It really does seem like a bizarre problem. |
Ads |
#32
|
|||
|
|||
Ethernet adapter interfering with Mouse
wrote in message ... On Jul 20, 4:33 am, "Pegasus [MVP]" wrote: wrote in message ... On Jul 19, 6:25 pm, "Pegasus [MVP]" wrote: Yes, it's possible to enable/disable your network adapter as part of your startup process even though this is a clumsy solution. If you cannot resolve the issue in a more elegant way then I would like you to post the exact name of your network adapter. You will find it in the Control Panel / Network Connections in the column headed "Device Name". As an example, the name of my adapter is "Broadcom NetXtreme Fast Ethernet". It is called "Intel(R) PRO/1000 PL Network Connection" ============= OK, here you go: 1. Create a folder c:\Tools. 2. Download devcon.exe fromhttp://download.microsoft.com/download/1/1/f/11f7dd10-272d-4cd2-896f-... and put it into the folder c:\Tools. 3. Copy & paste the code below into the file c:\Tools\DeviceEnabler.bat. Make sure to use the .bat extension - it won't work with a .txt extension. Do NOT retype the code - you're likely to make mistakes. 4. Remove all line numbers. 5. Click Start / Run 6. Type the three letters cmd and click OK. 7. Type this command: c:\Tools\DeviceEnabler. You should see two messages: One that says that your adapter was disabled, the other that it was enabled. 8. Adjust the delay value in Line 12 to suit your environment. Perhaps you can reduce it to 1 or 2 seconds. You now have two options to execute the batch file automatically. 9a. By means of a logon script. This method is simpler but it creates a black console screen at logon time. Using notepad.exe, create the file c:\documents and settings\all users\start menu\programs\startup\netlogon.bat and put these lines inside: @echo off call c:\Tools\DeviceEnabler.bat 9b. By means of a scheduled task. This method is a little more complex but it works invisibly in the background. Open the Control Panel, then the Task Scheduler, then create a new task with the following properties: - Name of Task: Device Enabler. - Command line: c:\Tools\DeviceEnabler.bat - Account to run under: Administrator - Schedule: To run at logon time. [01] @echo off [02] goto Start [03] --------------------------------------------------- [04] This batch file will disable the nominated network [05] adapter, wait 10 seconds, then re-enable it. [06] 20.7.2009 FNL [07] --------------------------------------------------- [08] :Start [09] setlocal enabledelayedexpansion [10] set Adapter=Intel(R) PRO/1000 PL Network Connection [11] call :Sub disable [12] ping localhost -n 9 nul [13] call :Sub enable [14] goto :eof [15] [16] :Sub [17] set HWID=x [18] set count=0 [19] set found=no [20] [21] c:\Tools\devcon hwids "PCI\*" "%temp%\device.txt" [22] for /F "tokens=*" %%* in ('type "%temp%\device.txt"') do ( [23] set /a count=!count! + 1 [24] if /i "%%*"=="Name: %Adapter%" set found=yes& set count=1 [25] if !found!==yes if !count!==3 set HWID=%%* [26] ) [27] if %found%==yes ( [28] c:\Tools\devcon %1 "!HWID!" [29] ) else ( [30] echo Device "%Adapter%" not found. [31] ) [32] del "%temp%\device.txt" Thank you for that script, Pegasus. Looks like batch file syntax has gotten a little more powerful since the DOS 6.22 days. I'd be interested in studying some of those commands later. But I can tell you that it works. I did take out lines 21 and 32, and replaced the 'type tempfile' command in line 22 with the command in line 21. Also, I thought the call command was non-blocking, which is why you need that ping command to simulate a sleep, but I just did some experimenting with that. I put in an echo statement as the first line of the subroutine, and then put in a ping for 10 seconds as the second line of the subroutine. I figured I would see two immediate printouts since the call command is supposed to be non-blocking, but I only saw the second printout after the first call to the subroutine had finished. Maybe this script is hitting some blocking aspect of the call command? Task Scheduler works fine (both the startup and logon options), although I do see the cmd window with the logon option. I also had success opening up gpedit.msc, and specifying the script as a startup script and also as a logon script - and the cmd window does not appear if I do it that way. Seems like whichever option I choose (whether Task Scheduler or gpedit.msc, and whether startup or logon), I can actually logon quickly enough and start doing stuff before the script executes. That's ok, I guess it's the best we can do. =============== Thanks for the feedback. I can't really comment on your observations you made in the second paragraph unless you post the actual code you used. Suffice it to say that it does not matter in the least whether you execute a command in the main part of the batch file or in the subroutine. I used a subroutine because it's bad programming practice to repeat code that is functionally almost identical. |
#33
|
|||
|
|||
Ethernet adapter interfering with Mouse
wrote in message ... On Jul 20, 4:33 am, "Pegasus [MVP]" wrote: wrote in message ... On Jul 19, 6:25 pm, "Pegasus [MVP]" wrote: Yes, it's possible to enable/disable your network adapter as part of your startup process even though this is a clumsy solution. If you cannot resolve the issue in a more elegant way then I would like you to post the exact name of your network adapter. You will find it in the Control Panel / Network Connections in the column headed "Device Name". As an example, the name of my adapter is "Broadcom NetXtreme Fast Ethernet". It is called "Intel(R) PRO/1000 PL Network Connection" ============= OK, here you go: 1. Create a folder c:\Tools. 2. Download devcon.exe fromhttp://download.microsoft.com/download/1/1/f/11f7dd10-272d-4cd2-896f-... and put it into the folder c:\Tools. 3. Copy & paste the code below into the file c:\Tools\DeviceEnabler.bat. Make sure to use the .bat extension - it won't work with a .txt extension. Do NOT retype the code - you're likely to make mistakes. 4. Remove all line numbers. 5. Click Start / Run 6. Type the three letters cmd and click OK. 7. Type this command: c:\Tools\DeviceEnabler. You should see two messages: One that says that your adapter was disabled, the other that it was enabled. 8. Adjust the delay value in Line 12 to suit your environment. Perhaps you can reduce it to 1 or 2 seconds. You now have two options to execute the batch file automatically. 9a. By means of a logon script. This method is simpler but it creates a black console screen at logon time. Using notepad.exe, create the file c:\documents and settings\all users\start menu\programs\startup\netlogon.bat and put these lines inside: @echo off call c:\Tools\DeviceEnabler.bat 9b. By means of a scheduled task. This method is a little more complex but it works invisibly in the background. Open the Control Panel, then the Task Scheduler, then create a new task with the following properties: - Name of Task: Device Enabler. - Command line: c:\Tools\DeviceEnabler.bat - Account to run under: Administrator - Schedule: To run at logon time. [01] @echo off [02] goto Start [03] --------------------------------------------------- [04] This batch file will disable the nominated network [05] adapter, wait 10 seconds, then re-enable it. [06] 20.7.2009 FNL [07] --------------------------------------------------- [08] :Start [09] setlocal enabledelayedexpansion [10] set Adapter=Intel(R) PRO/1000 PL Network Connection [11] call :Sub disable [12] ping localhost -n 9 nul [13] call :Sub enable [14] goto :eof [15] [16] :Sub [17] set HWID=x [18] set count=0 [19] set found=no [20] [21] c:\Tools\devcon hwids "PCI\*" "%temp%\device.txt" [22] for /F "tokens=*" %%* in ('type "%temp%\device.txt"') do ( [23] set /a count=!count! + 1 [24] if /i "%%*"=="Name: %Adapter%" set found=yes& set count=1 [25] if !found!==yes if !count!==3 set HWID=%%* [26] ) [27] if %found%==yes ( [28] c:\Tools\devcon %1 "!HWID!" [29] ) else ( [30] echo Device "%Adapter%" not found. [31] ) [32] del "%temp%\device.txt" Thank you for that script, Pegasus. Looks like batch file syntax has gotten a little more powerful since the DOS 6.22 days. I'd be interested in studying some of those commands later. But I can tell you that it works. I did take out lines 21 and 32, and replaced the 'type tempfile' command in line 22 with the command in line 21. Also, I thought the call command was non-blocking, which is why you need that ping command to simulate a sleep, but I just did some experimenting with that. I put in an echo statement as the first line of the subroutine, and then put in a ping for 10 seconds as the second line of the subroutine. I figured I would see two immediate printouts since the call command is supposed to be non-blocking, but I only saw the second printout after the first call to the subroutine had finished. Maybe this script is hitting some blocking aspect of the call command? Task Scheduler works fine (both the startup and logon options), although I do see the cmd window with the logon option. I also had success opening up gpedit.msc, and specifying the script as a startup script and also as a logon script - and the cmd window does not appear if I do it that way. Seems like whichever option I choose (whether Task Scheduler or gpedit.msc, and whether startup or logon), I can actually logon quickly enough and start doing stuff before the script executes. That's ok, I guess it's the best we can do. =============== Thanks for the feedback. I can't really comment on your observations you made in the second paragraph unless you post the actual code you used. Suffice it to say that it does not matter in the least whether you execute a command in the main part of the batch file or in the subroutine. I used a subroutine because it's bad programming practice to repeat code that is functionally almost identical. |
#34
|
|||
|
|||
Ethernet adapter interfering with Mouse
On Jul 19, 5:57*pm, "
wrote: I have tried 2 different mice (a Logitech and a Microsoft) on my laptop running Windows XP Pro SP3, and both of them were jerky. *I finally traced the problem to the built-in ethernet adapter. *Once I go into the Device Manager and disable the Intel Pro/1000 PL network adapter, then the mouse will be smooth. *It will still be smooth even if I subsequently re-enable the network adapter. *But if I restart Windows with the network adapter enabled, then the mouse will be jerky again. Not sure what's going on here, maybe it's a resource issue. *I noticed that the network adapter is on IRQ 16, and one of the USB Universal Host Controllers is also on IRQ 16. *But Windows won't let me change any of the resource settings for the mouse or the network adapter. *I also tried a different USB port and still had the same problem. Any idea on how to fix this? If not, then is there a way to disable and enable devices from the command line? *I'll just have a script disable and re-enable the network adapter on startup. Does the touch pad mouse work okay? Do you have the same problem when running on battery (no AC power is plugged in)? |
#35
|
|||
|
|||
Ethernet adapter interfering with Mouse
On Jul 19, 5:57*pm, "
wrote: I have tried 2 different mice (a Logitech and a Microsoft) on my laptop running Windows XP Pro SP3, and both of them were jerky. *I finally traced the problem to the built-in ethernet adapter. *Once I go into the Device Manager and disable the Intel Pro/1000 PL network adapter, then the mouse will be smooth. *It will still be smooth even if I subsequently re-enable the network adapter. *But if I restart Windows with the network adapter enabled, then the mouse will be jerky again. Not sure what's going on here, maybe it's a resource issue. *I noticed that the network adapter is on IRQ 16, and one of the USB Universal Host Controllers is also on IRQ 16. *But Windows won't let me change any of the resource settings for the mouse or the network adapter. *I also tried a different USB port and still had the same problem. Any idea on how to fix this? If not, then is there a way to disable and enable devices from the command line? *I'll just have a script disable and re-enable the network adapter on startup. Does the touch pad mouse work okay? Do you have the same problem when running on battery (no AC power is plugged in)? |
#36
|
|||
|
|||
Ethernet adapter interfering with Mouse
On Jul 21, 2:16*pm, Jose wrote:
On Jul 19, 5:57*pm, " wrote: I have tried 2 different mice (a Logitech and a Microsoft) on my laptop running Windows XP Pro SP3, and both of them were jerky. *I finally traced the problem to the built-in ethernet adapter. *Once I go into the Device Manager and disable the Intel Pro/1000 PL network adapter, then the mouse will be smooth. *It will still be smooth even if I subsequently re-enable the network adapter. *But if I restart Windows with the network adapter enabled, then the mouse will be jerky again. Not sure what's going on here, maybe it's a resource issue. *I noticed that the network adapter is on IRQ 16, and one of the USB Universal Host Controllers is also on IRQ 16. *But Windows won't let me change any of the resource settings for the mouse or the network adapter. *I also tried a different USB port and still had the same problem. Any idea on how to fix this? If not, then is there a way to disable and enable devices from the command line? *I'll just have a script disable and re-enable the network adapter on startup. Does the touch pad mouse work okay? Yeah, when using the touchpad, the mouse pointer moves very smoothly, no matter what. Do you have the same problem when running on battery (no AC power is plugged in)? That's actually how I discovered that it is the ethernet adapter causing the problem. I first noticed the jerky mouse while having the AC adapter plugged in. Then I noticed that the mouse pointer would move smoothly if I unplugged the AC adapter and ran off the battery. That's because the network adapter is set up to be turned off if the laptop is running on the battery. |
#37
|
|||
|
|||
Ethernet adapter interfering with Mouse
On Jul 21, 2:16*pm, Jose wrote:
On Jul 19, 5:57*pm, " wrote: I have tried 2 different mice (a Logitech and a Microsoft) on my laptop running Windows XP Pro SP3, and both of them were jerky. *I finally traced the problem to the built-in ethernet adapter. *Once I go into the Device Manager and disable the Intel Pro/1000 PL network adapter, then the mouse will be smooth. *It will still be smooth even if I subsequently re-enable the network adapter. *But if I restart Windows with the network adapter enabled, then the mouse will be jerky again. Not sure what's going on here, maybe it's a resource issue. *I noticed that the network adapter is on IRQ 16, and one of the USB Universal Host Controllers is also on IRQ 16. *But Windows won't let me change any of the resource settings for the mouse or the network adapter. *I also tried a different USB port and still had the same problem. Any idea on how to fix this? If not, then is there a way to disable and enable devices from the command line? *I'll just have a script disable and re-enable the network adapter on startup. Does the touch pad mouse work okay? Yeah, when using the touchpad, the mouse pointer moves very smoothly, no matter what. Do you have the same problem when running on battery (no AC power is plugged in)? That's actually how I discovered that it is the ethernet adapter causing the problem. I first noticed the jerky mouse while having the AC adapter plugged in. Then I noticed that the mouse pointer would move smoothly if I unplugged the AC adapter and ran off the battery. That's because the network adapter is set up to be turned off if the laptop is running on the battery. |
#38
|
|||
|
|||
Ethernet adapter interfering with Mouse
|
#39
|
|||
|
|||
Ethernet adapter interfering with Mouse
|
#40
|
|||
|
|||
Ethernet adapter interfering with Mouse
On Jul 21, 1:21*pm, "Pegasus [MVP]" wrote:
Thanks for the feedback. I can't really comment on your observations you made in the second paragraph unless you post the actual code you used. Suffice it to say that it does not matter in the least whether you execute a command in the main part of the batch file or in the subroutine. I used a subroutine because it's bad programming practice to repeat code that is functionally almost identical. 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, 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". So based on that behavior, it would seem that the ping command isn't necessary at all in the script. It seems to work fine without it. But now I'm confused about when the call command is blocking and when it is non-blocking. @echo off goto Start --------------------------------------------------- This batch file will disable the nominated network adapter, wait 10 seconds, then re-enable it. 20.7.2009 FNL --------------------------------------------------- :Start setlocal enabledelayedexpansion set Adapter=Intel(R) PRO/1000 PL Network Connection call :Sub disable call :Sub enable goto :eof :Sub echo Entering Sub ping localhost -n 9 nul set HWID=x set count=0 set found=no for /F "tokens=*" %%* in ('c:\Tools\devcon hwids "PCI\*"') do ( set /a count=!count! + 1 if /i "%%*"=="Name: %Adapter%" set found=yes& set count=1 if !found!==yes if !count!==3 set HWID=%%* ) if %found%==yes ( c:\Tools\devcon %1 "!HWID!" ) else ( echo Device "%Adapter%" not found. ) echo Exiting Sub |
#41
|
|||
|
|||
Ethernet adapter interfering with Mouse
On Jul 21, 1:21*pm, "Pegasus [MVP]" wrote:
Thanks for the feedback. I can't really comment on your observations you made in the second paragraph unless you post the actual code you used. Suffice it to say that it does not matter in the least whether you execute a command in the main part of the batch file or in the subroutine. I used a subroutine because it's bad programming practice to repeat code that is functionally almost identical. 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, 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". So based on that behavior, it would seem that the ping command isn't necessary at all in the script. It seems to work fine without it. But now I'm confused about when the call command is blocking and when it is non-blocking. @echo off goto Start --------------------------------------------------- This batch file will disable the nominated network adapter, wait 10 seconds, then re-enable it. 20.7.2009 FNL --------------------------------------------------- :Start setlocal enabledelayedexpansion set Adapter=Intel(R) PRO/1000 PL Network Connection call :Sub disable call :Sub enable goto :eof :Sub echo Entering Sub ping localhost -n 9 nul set HWID=x set count=0 set found=no for /F "tokens=*" %%* in ('c:\Tools\devcon hwids "PCI\*"') do ( set /a count=!count! + 1 if /i "%%*"=="Name: %Adapter%" set found=yes& set count=1 if !found!==yes if !count!==3 set HWID=%%* ) if %found%==yes ( c:\Tools\devcon %1 "!HWID!" ) else ( echo Device "%Adapter%" not found. ) echo Exiting Sub |
#42
|
|||
|
|||
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 |
#43
|
|||
|
|||
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 |
#44
|
|||
|
|||
Ethernet adapter interfering with Mouse
On Jul 21, 4:27*pm, "Pegasus [MVP]" wrote:
*** 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 Here is the documentation I found for the call command: http://www.microsoft.com/resources/d....mspx?mfr=true It says: "Calls one batch program from another without stopping the parent batch program." So it sounds like each "call" command will, in effect, start a separate thread. So the main program would launch the subroutine with the "disable" parameter, and then it would immediately launch the subroutine again with the "enable" parameter, and you'd be trying to disable and enable the network adapter at the same time. That's why I thought the ping command to simulate a sleep was necessary, to force the enable function to be performed after the disable function was finished. But the behavior I am noticing seems to indicate that a sleep isn't necessary, and that contradicts the documentation. |
#45
|
|||
|
|||
Ethernet adapter interfering with Mouse
On Jul 21, 4:27*pm, "Pegasus [MVP]" wrote:
*** 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 Here is the documentation I found for the call command: http://www.microsoft.com/resources/d....mspx?mfr=true It says: "Calls one batch program from another without stopping the parent batch program." So it sounds like each "call" command will, in effect, start a separate thread. So the main program would launch the subroutine with the "disable" parameter, and then it would immediately launch the subroutine again with the "enable" parameter, and you'd be trying to disable and enable the network adapter at the same time. That's why I thought the ping command to simulate a sleep was necessary, to force the enable function to be performed after the disable function was finished. But the behavior I am noticing seems to indicate that a sleep isn't necessary, and that contradicts the documentation. |
Thread Tools | |
Display Modes | |
|
|