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

DonationCoder.com Software > Post New Requests Here

Turn a batch file into an AHK script.

<< < (6/16) > >>

pilgrim:
Now that was the one we needed. :Thmbsup:

I changed the details in the script for one of my existing VPN's, created a shortcut and placed it in the PPTP toolbar - 1 click on, 1 click off.
The 2 command windows appear as before, the first one disappears almost immediately, the second one shows the changing status of the connection attempt (which is very useful) and disappears once it connects.

I left the cmdow.exe file in the System32 folder which is where I originally put it.

I have set up my 3 most used PPTP VPN's and the only problem I have is an 807 error on one of them, I don't think it's a port problem as all three are from the same provider so the server might be down at the moment.
Although I have not set it up permanently I ran a test with an L2TP connection and that worked fine as well.

Something I realised when I was changing VPN's is there is no indication as to which one is connected, the icon is showing 'PPTPcheck.exe' when I move the cursor over it.
To avoid any problems I have put a shortcut in the toolbar to the OFF batch file, it works for all PPTP connections (L2TP as well) and still only needs one click.
This is probably not necessary but sometimes I finished up with the PPTPcheck icon out of synch with the connection status, a couple of clicks on any ON icon sorts it out but this stops it happening.

As you said this latest script has considerably reduced the number of batch files needed.

If only MS had never removed the icons in the first place!


All the VPN's I use regularly I have accounts for (fortunately free) but I also have bookmarks for another 12 VPN's, 10 PPTP and 2 L2TP and I was surprised to see that the one you used wasn't amongst them.
When I first started using them there were hardly any about and few if any of them were free, now they are popping up all over the place although I'm not sure that I would trust the security of some of them.

4wd:
Something I realised when I was changing VPN's is there is no indication as to which one is connected, the icon is showing 'PPTPcheck.exe' when I move the cursor over it.-pilgrim (May 04, 2013, 11:10 AM)
--- End quote ---

Short term memory loss ?  ;)

EDIT: For some weird reason I can't get the ToolTip to change to something other than the executable name, (I was going to make it the passed NIC name), more reading to be done.-4wd (May 02, 2013, 06:53 AM)
--- End quote ---

To avoid any problems I have put a shortcut in the toolbar to the OFF batch file, it works for all PPTP connections (L2TP as well) and still only needs one click.
This is probably not necessary but sometimes I finished up with the PPTPcheck icon out of synch with the connection status, a couple of clicks on any ON icon sorts it out but this stops it happening.
--- End quote ---

I don't see how that can happen unless you're switching connections faster than the 5 second interval PPTPchek uses between rasdial.exe calls, ie. the longest PPTPchek should be active after a disconnection is 5 seconds.

This was a trade-off between increased CPU usage and a reasonably short update period - there's probably another way I could use to check connection status, (using a WMI or DLL call), but rasdial.exe was quick and easy.  I might look into it a bit further.

When I first started using them there were hardly any about and few if any of them were free, now they are popping up all over the place although I'm not sure that I would trust the security of some of them.
--- End quote ---

But since most of them are purely for the purpose of accessing region restricted media content, that shouldn't be a problem.

UPDATE: PPTPchek

* Start monitor delay will be terminated as soon as the rasdial.exe process terminates.
* ToolTip now indicates connection name.

pilgrim:
Short term memory loss ?  ;)
--- End quote ---

Brain dead!
Actually I had exploratory brain surgery once.............but they never found anything. :D

The icon being out of sync happened a couple of times when I had a VPN connected and then clicked on another one without closing the first. (Having forgotten which one was connected. :o)
It was always with the icon missing when the next connection became active, clicking on the same shortcut a second time shut everything down, the third time put it back in sync.

I'll try the update later but if the tooltip now shows the connection name it does everything I want. (Unless of course you find a way to incorporate the other two netshell icons to indicate traffic flow.)

While VPN's are useful for the reason you mention I run one all the time, in my view it puts an extra layer between me and the connection's end point which can't be a bad thing.
When I first got interested in them I was in touch with a blogger whose site was all about online privacy and I am still in touch with one VPN provider who I helped with a couple of things when he was getting established.

IainB:
Not sure whether this is relevant at this stage, but instead of using Windows batch commands, you might like to consider using the TakeCommand language. It's based on the Windows command line and batch instructions, but provides a much more powerful instruction set.
I used it some years back and it really was superb.
I only mention it now as it is coming on BitsDJ special offer of 50% at US$49.97. (Click on link.)

pilgrim:
IainB,

Thanks for the suggestion but.......
I am trying to avoid installing any extra software to do what I am trying to do. (AHK was an exception.)
Buying any software is not a consideration.

I have at most half a dozen more things to sort out and I will have achieved everything I am trying to do.
It's not a question of having more ways of doing things but of understanding those that I already have.
There are two main options available to me, AHK and batch files, between them they should cover anything I am likely to want to do.

AHK is like learning German, I know a very small number of words but putting them together into a sentence is largely beyond me.
Batch files are like learning French, I can usually make myself understood but the grammar and the punctuation are all over the place, so what comes out to begin with is not always what I had in mind.

That's where the good people on DC help me out, they can translate my ideas into commands that a computer can understand, which is more than I can sometimes do.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version