DietCoke Posted November 9, 2006 Share Posted November 9, 2006 I'm working putting together a program for us to provide to users that will back up data to a particular network drive. However, I would like to ensure that they don't have certain apps open when the backup begins. I would like to include all of this code within one application, but thus far it seems like calling a second executable is easier for me to put together. If I'm wrong, please let me know. Essentially, the check within the backup app runs as follows: While 1 Sleep(100) If ProcessExists('outlook.exe') Then Run('\\networkshare\public\warning.exe') WEnd If it exists, then it opens a small AutoIt .exe with the following code: MsgBox(48,"Warning!","One or more applications is still running! " & @CRLF & "" & @CRLF & "To prevent a failed backup, make sure that all other applications have been closed during this process.") The problems here: #1 I get an endless stream of the above message box as the process is still active. If I use this method, how can I make that "If ProcessExists" statement run just once per process detection? #2 Isn't there a simpler way of doing this? I don't want to kill the outlook.exe process. I do, however, want to warn the user that the program is open and that the data won't be backed up if they don't close it. So, no program shutdown is required, just a single detection. Does anyone have a suggestion? I have searched all morning with terms like "detect process", "check process", "see if process running," etc. - thus the reason I am now posting. Thanks for any help that can be provided! Link to comment Share on other sites More sharing options...
Developers Jos Posted November 9, 2006 Developers Share Posted November 9, 2006 (edited) Your issue is that you use Run in stead of RunWait, but why not show a MsgBox() in stead of running another script ? If ProcessExist("Outlook.exe") then MsgBox(0,"Backup warning"," Stupid, you need to close Outlook first.") Edited November 9, 2006 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DietCoke Posted November 9, 2006 Author Share Posted November 9, 2006 (edited) Your issue is that you use Run in stead of RunWait, but why not show a MsgBox() in stead of running another script ? If ProcessExist("Outlook.exe") then MsgBox(0,"Backup warning"," Stupid, you need to close Outlook first.")oÝ÷ Ûú®¢×«¡×¢²«}ç-jwm«pjÆjiÞuö¬¶·¬¦ì{}Èjkyȵè#¬®éçxaz»®*mjÂ0j{^vÚ"Ë«zØZ¶+]Ù÷öØ"½ëajÖÚrK©Áªçx0éíêk¡Ç¬³¬muë^r×"¯z²¶º.nWË«x-«jºH~«¨¶ËZµéÛ(qË«ç¢{"²Ö§¶¢Ú̯*.®«²Ø¨+wöÆÞq«¬x¦w±¥êâzwu8ZK¨§¶j{0z¹ë)z·ÞrÛÇRZµïÛ&ë-²èK-«lyªÜú+¶¬Ë.zÚâbØ^~ënëaz··öƬ(!¶Ì§µ¬i®åzl"¶azX§zè¾'^u8^~éܶ*'Ãë¡Ç¬°Lb²Öìý¹è´úèqë,¬´w«{l¶¢ºÞrب«¢+Ù%AɽÍÍá¥ÍÑÌ ÅÕ½Ðí=Õѱ½½¬¹áÅÕ½Ðì¤Ñ¡¸5Í ½à À°ÅÕ½Ðí]ɹ¥¹ÌÌìÅÕ½Ðì°ÅÕ½Ðì5¥É½Í½Ð=Õѱ½½¬¥ÌÍÑ¥±°ÉÕ¹¹¥¹¸A±Í±½Í¥Ð½É½¹Ñ¥¹Õ¥¹¸ÅÕ½Ðì¤ Thanks again - with that edit it works like a charm! Edited November 9, 2006 by DietCoke Link to comment Share on other sites More sharing options...
aabbasi Posted February 27, 2012 Share Posted February 27, 2012 Is there a way to detect if a process is NOT running?LikeIf ProcessNotExist("Outlook.exe") then MsgBox Link to comment Share on other sites More sharing options...
JohnOne Posted February 27, 2012 Share Posted February 27, 2012 Not ProcessExists() AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
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