Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords:
The purpose of this program is the automation of exiting and closing Outlook, when going from a offline notebook with Off-line Outlook to On-line Via a VPN which kicks off the Script to Close Outlook and restart it On-line.
Here is an example of my code:
;Addextender("wproc34I.dll") AddExtender("wwprc44i.dll") id=tListProc() handle = FileOpen("c:\stuff.txt", "WRITE") FileWrite(handle, id) FileClose(handle) a= StrIndex(id, "OUTLOOK.exe", 1, @FWDSCAN) b = StrSub(id,(a+12), 3) Olookid = int(b) flag=3 handle2=tOpenProc(Olookid,flag) tKillProc(handle2) tCloseProc(handle2) Exit
;Addextender("wproc34I.dll") AddExtender("wwprc44i.dll") proclist=tlistproc() ;Get pointers to proc-name and proc-id procptr=StrIndexNc(proclist,"OUTLOOK.EXE",1,@FWDSCAN) if procptr==0 then exit pipeptr=StrIndexNc(proclist,"|",procptr,@FWDSCAN) tabptr=StrIndexNc(proclist,@tab,pipeptr,@FWDSCAN) ;handle if process is at end of string if tabptr == 0 then tabptr=strlen(proclist) procname=StrSub(proclist,procptr,pipeptr-procptr) procid=StrSub(proclist,pipeptr+1,tabptr-pipeptr) if Procid!="" hProcess=tOpenProc(procid,3);PROCESS_TERMINATE if hProcess tKillProc(hProcess) tcloseproc(hProcess) Message("tKillProc","%procname% is terminated") endif else Message("tKillProc","Need a valid process id") endif
Article ID: W14550
Filename: tCloseProc( ) to Close a Program.txt
File Created: 2013:04:01:09:12:16
Last Updated: 2013:04:01:09:12:16