Sfor Posted April 21, 2008 Posted April 21, 2008 (edited) The Polish authorities released a new version of application designed to make and send reports and declarations over the internet. The application is compulsory. Only small firms with less than 5 workers do not have to use it.The newest version has a problem while working in Windows 98 enviroment. The application is checking if proper certificates are installed in the system storage. This procedure works fine on newer systems, but in case of Windows 98 it tries to contact some certain internet servers. The servers are not responding, so the application waits for the time out. With many certificates to be checked, the application freezes for several minutes. (Strangest thing is the Windows 2000 and XP do not contact the servers to verify the certificates). The best solution is to delete the default route (with the ROUTE command) and to set own route entries excluding the IP of the servers used during certificate checking, so far. It works quite well in the LAN with an internet gateway enviroment. In case of a Dial-Up connection it is necesary to run the route change script manualy, after starting each Dial-Up connection session.So, I'm looking for an automatic ways of running a batch script after connecting through a Dial-Up.Still I'm quite interested of what is so unique in the Windows 98, so the certificates are verified in a different way, than in Windows 2000 or XP. Edited April 21, 2008 by Sfor
Mijzelf Posted April 23, 2008 Posted April 23, 2008 Is it enough to be able to dialup from a batchfile so you can put your code behind it? In that case you can use RasDial95.
Sfor Posted April 23, 2008 Author Posted April 23, 2008 (edited) Unfortunatelly, the application I mentioned starts Dial-Up connections by itself. So, making a connection from a batch will not work in this particular case. Because, the user would have to do it, instead of the application. Edited April 23, 2008 by Sfor
Mijzelf Posted April 24, 2008 Posted April 24, 2008 I wrote a little program#define WINVER 0x401#include <windows.h>#include <ras.h>int main(int argc, char *argv[]){ HANDLE hEvent = ::CreateEvent( 0, 0, 0, 0 ); if( INVALID_HANDLE_VALUE == hEvent ) return 1; if( 0 != ::RasConnectionNotification( (HRASCONN)INVALID_HANDLE_VALUE, hEvent, RASCN_Connection ) ) { ::CloseHandle( hEvent ); return 2; } if( WAIT_OBJECT_0 != ::WaitForSingleObject( hEvent, INFINITE ) ) { ::CloseHandle( hEvent ); return 3; } ::CloseHandle( hEvent ); return 0;}which returns with no errorlevel when a rasconnection is made. So you could call it in a batchfile, and when it returns do your job::BeginWaitForRasif ERRORLEVEL 1 goto Endroute ...goto Begin:EndStart this batch before the user program starts. If this will work for you depends on how fast the user program reacts on the new connection. You can get the compiled code here. Rename it to .zip.(How do you add an attachment to a posting?)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now