ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Advice needed on AHK script

<< < (8/8)

4wd:
There must be some strange timing issues on your computer, (which don't seem to appear on any of mine), for /m not to work with D4 and NAI occasionally.-4wd (May 17, 2013, 11:58 AM)
--- End quote ---

I actually tried setting them all to /m before I tried /k but only the /k worked properly.-pilgrim (May 18, 2013, 03:56 AM)
--- End quote ---

/m won't work on PeerBlock/SandBoxie because they won't allow other programs to close them, (security measure I presume), therefore it's context menu or just kill them.

No, it was purely cosmetic so that you do not actually see the icon moving.
--- End quote ---

Yes...well, given your systems fussiness towards things that are too fast....it's set at the second fastest setting.  At the fastest, the mouse gets teleported to the position - exactly what CleanTray does but your system didn't like that.

Oh, forgot, can you try Terminator.exe /c on PeerBlock/SandBoxie again - added a couple of small, (5ms or so), delays into the mix.

pilgrim:
No, it was purely cosmetic so that you do not actually see the icon moving.
--- End quote ---

That was meant to be the cursor, not the icon. I was wondering if the cursor could be hidden when it was moving?

CleanTray: Appears to be working without problems.

Terminator: Went back to your script above (Reply 29) and it shut everything down except Peerblock. I just changed that to /b and left the rest as it was, it worked. As it was working I never tried any of the other combinations of switches.

Each of the above was tried at least a dozen times.

I tried adding a PPTP VPN to both of the above and got some interesting results.
I tried it with CleanTray and PPTPchek shut down every time. I then tried it with Terminator and it hung, went back to CleanTray and it was hanging with that as well.
From then on it was hanging more often than not with both programs.
I know we have a separate thread for PPTPchek but I thought it worth mentioning here as it relates to testing the other two programs.

4wd:
I tried it with CleanTray and PPTPchek shut down every time. I then tried it with Terminator and it hung, went back to CleanTray and it was hanging with that as well.-pilgrim (May 18, 2013, 09:54 AM)
--- End quote ---

OK, now that's just strange, I'll go back to seeing if I can find another way to check for PPTP/L2TP connections.

In the meantime, your batch file could do with a little rearrangement, (didn't really take notice before  :-[ ).  By rights you should be closing down in the opposite order to the setting up, so:


--- Code: Text ---netsh interface show interface "Router Connection" | find /i "disabled" >NULif errorlevel 1 goto running rem Turning Internet items ONstart /D "C:\Program Files (x86)\D4" D4.exestart /D "C:\Program Files (x86)\network-activity-indicator" NetworkIndicator.exestart /D "C:\Program Files (x86)\Sandboxie" SbieCtrl.exestart /D "C:\Program Files (x86)\PeerBlock" peerblock.exe netsh interface set interface "Router Connection" ENABLED goto alldone :runningrem Internet is ON, turn it all OFF now rasdial /disconnectnetsh interface set interface "OpenVPN Adapter" DISABLEDnetsh interface set interface "Router Connection" DISABLED terminator.exe /b peerblock.exeterminator.exe /c SbieCtrl.exeterminator.exe /m NetworkIndicator.exeterminator.exe /m D4.exe :alldone
Also, if Terminator works there shouldn't be a need for CleanTray to be run, soooo, having the VPN disconnection first might be enough of a delay such that by the time Terminator runs, PPTPchek has already exited because the VPN no longer exists.

Anyways, back the PPTPchek drawing board...

pilgrim:
There is actually a madness to my method. (Or should that be the other way round?)  :)

The start commands are in the order the icons are arranged in the tray, right to left from the top.
The terminate commands are in reverse order except for NAI, the reason for that is because in the short time it takes for everything to shut down it gives the NAI icon time to indicate that the main connection has been disabled, it greys out.
I agree that the disconnect/disable commands needed rearranging as the main connection should have been last.

I have now rearranged it to the following:

netsh interface show interface "Router Connection" | find /i "disabled" >NUL
if errorlevel 1 goto running

rem Turning Internet items ON
start /D "C:\Program Files (x86)\D4" D4.exe
start /D "C:\Program Files (x86)\Sandboxie" SbieCtrl.exe
start /D "C:\Program Files (x86)\PeerBlock" peerblock.exe
start /D "C:\Program Files (x86)\network-activity-indicator" NetworkIndicator.exe

netsh interface set interface "Router Connection" ENABLED

goto alldone

:running
rem Internet is ON, turn it all OFF now

rasdial /disconnect
netsh interface set interface "OpenVPN Adapter" DISABLED
netsh interface set interface "Router Connection" DISABLED

terminator.exe /b peerblock.exe
terminator.exe /c SbieCtrl.exe
terminator.exe /m D4.exe
terminator.exe /m NetworkIndicator.exe

:alldone
--- End quote ---

Until now I have still been using taskkill and RefreshTray as I have tried so many variations of programs I wanted to be able to fall back each night on one that I knew was working.

I tried various modifications on the existing RefreshTray script to stop the pop-up from opening but nothing worked, so if there is an answer in AHK it looks like it needs an extra command.
I found that USB SR has an option to disable mouse-over for its pop-up but that means it needs to be activated manually and once it opens it stays there until I close it manually, no point.

4wd:
Source added to Terminator archive, maybe someone can make it a lot better, (and neater please).

Navigation

[0] Message Index

[*] Previous page

Go to full version