proc main integer taskid switch $OSVER ;Check for operating system case "5.01" ;XP run "rasphone.exe -d CONNECTION" taskid ;Launch DUN connection, replace CONNECTION with actual value pause 2 while taskexists taskid ;Loop while connection is being dialed if $ACTIVEWIN == $PWMAINWIN ;Check to see if current window is Procomm pause 2 if $ACTIVEWIN == $PWMAINWIN ;Check again exitwhile ;If so, presume connection made and exit endif endif yield endwhile endcase case "5.00" ;Win2K run "rasphone.exe -d CONNECTION" taskid ;Launch connection pause 2 while taskexists taskid ;Loop while connection is being dialed yield endwhile endcase case "4.00" ;Win95 case "4.10" ;Win98 case "4.90" ;WinME run "RUNDLL RNAUI.DLL,RnaDial CONNECTION" taskid;Launch connection pause 2 while taskexists taskid ;Loop while connection is being dialed yield endwhile endcase default errormsg "Unsupported operating system! Script exiting." exit endcase endswitch endproc