15 February 2020



REM Copy semua dan paste ke notepad dan save sebagai Start.bat


@echo off
REM https://stackoverflow.com/questions/162291/how-to-check-if-a-process-is-running-via-a-batch-script

SETLOCAL EnableExtensions
set P1=iFAct.exe
set P2=OUTLOOK.EXE

:Program1
REM Check if iFAct is running
FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %P1%"') DO IF %%x == %P1% goto iFActFound
echo Starting iFAct
start /min "" "C:\Users\Public\ifact\3.0.0.5\iFAct.exe"

goto Program2

:iFActFound
echo iFAct already Running


:Program2
REM Check if Outlook is running
FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %P2%"') DO IF %%x == %P2% goto OUTLOOKFound
echo Starting Outlook
start /min "" "C:\Users\othmmohd\appdata\roaming\microsoft\internet explorer\quick launch\user pinned\taskbar\outlook 2016.lnk"

:OUTLOOKFound
echo Outlook already running

TIMEOUT 1

del "C:\Users\othmmohd\Documents\A_Emails_Attachments\*.png"
del "C:\Users\othmmohd\Documents\A_Emails_Attachments\*.msg"
del "C:\Users\othmmohd\Documents\A_Emails_Attachments\*.doc*"
del "C:\Users\othmmohd\Documents\A_Emails_Attachments\*.jpg*"
del "C:\Users\othmmohd\Documents\A_Emails_Attachments\*.ppt*"
del "C:\Users\othmmohd\Documents\A_Emails_Attachments\*.pdf"
del "C:\Users\othmmohd\Documents\A_Emails_Attachments\*.xls*"

timeout 2

No comments: