now=dirscript() move=dirwindows(1) If fileexist("%now%WBDEI44I.DLL")==@TRUE then filemove("WBDEI44I.DLL",move,@FALSE) LookFor="dsNetworkConnect.exe" Mdrive="K:\YourLogon\RemMap.vbs" IEpath="https://egate.YourDomain.com/dana-na/auth/url_default/welcome.cgi" messnumA=0 messnumB=0 MyVariable1=0 MyVariable2=0 if AppExist(LookFor,@TRUE)==@TRUE then messnumA=1 if DirExist("H:\")==@TRUE then messnumB=2 messnum= messnumA + messnumB Switch messnum case 0 runZoomwait("explorer.exe",IEpath) gosub MAP break case 1 MyDialogFormat=`WWWDLGED,6.1` MyDialogCaption=`YourDomain Remote Connect` MyDialogX=074 MyDialogY=239 MyDialogWidth=176 MyDialogHeight=083 MyDialogNumControls=005 MyDialogProcedure=`DEFAULT` MyDialogFont=`DEFAULT` MyDialogTextColor=`DEFAULT` MyDialogBackground=`DEFAULT,DEFAULT` MyDialogConfig=0 MyDialog001=`035,063,036,012,PUSHBUTTON,DEFAULT,"OK",1,1,32,DEFAULT,DEFAULT,DEFAULT` MyDialog002=`091,063,036,012,PUSHBUTTON,DEFAULT,"Cancel",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog003=`013,029,068,012,CHECKBOX,MyVariable1,"Map your drives only",1,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog004=`013,043,152,012,CHECKBOX,MyVariable2,"Break current VPN connection, reconnect, and map drives.",1,4,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog005=`011,011,152,016,STATICTEXT,DEFAULT,"It looks as though you're already connected, would you like to:",DEFAULT,5,DEFAULT,"Microsoft Sans Serif|5632|70|34","0|0|0",DEFAULT` ButtonPushed=Dialog("MyDialog") if MyVariable1==1 then gosub MAP if MyVariable2==1 then gosub REDO break case 2 gosub REDO break case 3 gosub NEWREDO break Endswitch Exit :MAP tmout=0 While 1 tmout=tmout + 1 app=AppExist(LookFor,@TRUE) if app==@TRUE then break if tmout==25 then exit endwhile if MyVariable1!=1 While 1 file=FileExist(Mdrive) if file==@TRUE then break endwhile endif Boxopen("Login","Mapping Drives....") a=0 While a<5 test=Fileexist(Mdrive) if test==@FALSE then exit if test==@TRUE runwait(Mdrive,"") break endif endwhile return :REDO IntControl(56,LookFor,1,@FALSE,0) runZoomwait("explorer.exe",IEpath) gosub MAP return :NEWREDO MyDialogFormat=`WWWDLGED,6.1` MyDialogCaption=`YourDomain Remote Connect` MyDialogX=074 MyDialogY=239 MyDialogWidth=166 MyDialogHeight=059 MyDialogNumControls=003 MyDialogProcedure=`DEFAULT` MyDialogFont=`DEFAULT` MyDialogTextColor=`DEFAULT` MyDialogBackground=`DEFAULT,DEFAULT` MyDialogConfig=0 MyDialog001=`033,039,036,012,PUSHBUTTON,DEFAULT,"Yes",1,1,32,DEFAULT,DEFAULT,DEFAULT` MyDialog002=`089,039,036,012,PUSHBUTTON,DEFAULT,"No",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog003=`007,009,152,024,STATICTEXT,DEFAULT,"It looks as though you're already connected and your drives are mapped. Would you like to break the VPN connection, reconnect, and map drives?",DEFAULT,5,DEFAULT,"Microsoft Sans Serif|5632|70|34","0|0|0",DEFAULT` ButtonPushed=Dialog("MyDialog") If buttonpushed==1 then gosub REDO return