ReAslan Posted May 28, 2015 Share Posted May 28, 2015 Hello everyone I need urgent help .Let me explain : I need a AutoIt script that automatically do three things :1 ) If it detects that the program is closed open it .2 ) If it detects that the program is open it does not do anything .3 ) If it detects that the program is blocked closes and restarts .The AutoIt script must be run in the background and automatically continue to do the three things described above .I understand that I must act on tasklist which contains all the processes but are not expert in c++ language.The script must be run on Windows 2000 .Thanks in advance to all Link to comment Share on other sites More sharing options...
Exit Posted May 28, 2015 Share Posted May 28, 2015 And what you tried so far ? App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
water Posted May 28, 2015 Share Posted May 28, 2015 Stop posting the same "question" over and over again or your stay on this forum will be quite short.Take a look at the forum rules and you will see what we expect from new users! My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 28, 2015 Moderators Share Posted May 28, 2015 ReAslan,At last an AutoIt question - a bit better than your other 3 threads which I have now deleted. But still posted in the wrong section - I have moved it for you but I would ask you to be more careful in the future. And a word to the wise, if you keep posting the same question again and again you might find reincarnation a little more difficult than did your namesake.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Starstar Posted May 28, 2015 Share Posted May 28, 2015 HotKeySet("{ESC}", "Terminate") Func Terminate() Exit EndFunc ;==>Terminate While 1 if ProcessExists("progrm.exe") Then Sleep(100) Elseif not ProcessExists("progrm.exe") Then ShellExecute(@DesktopDir&"\program.exe") Else Shutdown(2) Endif WendTry this one....... Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
Developers Jos Posted May 28, 2015 Developers Share Posted May 28, 2015 HotKeySet("{ESC}", "Terminate") Func Terminate() Exit EndFunc ;==>Terminate While 1 if ProcessExists("progrm.exe") Then Sleep(100) Elseif not ProcessExists("progrm.exe") Then ShellExecute(@DesktopDir&"\program.exe") Else Shutdown(2) Endif Wend Try this one.......Are you sure?Why have the ElseIf test again the existence of a program?Under what condition will you reach the Else condition?Jos 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...
Bert Posted May 28, 2015 Share Posted May 28, 2015 I hate to say it seeing how two mods have weighted in -1. Why the specific OS?2. is it something that is installing?3. If an installer - can you do the install silently? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
SadBunny Posted May 28, 2015 Share Posted May 28, 2015 What do you mean by 3, "the program is blocked"? Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Bert Posted May 28, 2015 Share Posted May 28, 2015 What do you mean by 3, "the program is blocked"?I caught that myself....why would the program be blocked? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
argumentum Posted May 28, 2015 Share Posted May 28, 2015 he can write a batch file. No need for a script. Do need to attend to the antivirus tho. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
argumentum Posted May 28, 2015 Share Posted May 28, 2015 goto https://technet.microsoft.com/en-us/sysinternals/bb896682.aspx , get that and run this batch file:@echo off :start pslist notepad if errorlevel 0 if not errorlevel 1 goto IsRunning if errorlevel 1 if not errorlevel 2 start /b notepad.exe :exit echo was not running, now is, keep checking in 4 sec. ping 12.0.0.1 -w 1000 > nul goto start pause exit :IsRunning echo yes, is running, keep checking in 4 sec. ping 12.0.0.1 -w 1000 > nul goto start pause exit :endtested in win 2000 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Bert Posted May 29, 2015 Share Posted May 29, 2015 yuck! has a GOTO in it. GOTO is evil! argumentum 1 The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
ReAslan Posted May 29, 2015 Author Share Posted May 29, 2015 (edited) Hello everyone , Thanks for giving me the question moved in the right section and thank you for the answers .argumentum tried the .bat file and I do not recognize the command " pslist " But I understood the meaning . However I can not correct the error of command pslist not recognized .With locked program , I mean that the process is in the " not responding" and then it goes off and on again , or restart. Is the operating system is Windows 2000 and would be nice to be a script is a .bat file c ++ / c Edited May 29, 2015 by Jos removed codebox around text to make it readable. Link to comment Share on other sites More sharing options...
SadBunny Posted May 29, 2015 Share Posted May 29, 2015 PsList is part of the SysInternals tool suite. See https://technet.microsoft.com/en-us/sysinternals/bb896682.aspxAbout the C/C++ you mentioned twice... You do realize you're on a forum for another language? Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
argumentum Posted May 29, 2015 Share Posted May 29, 2015 Andrea, I understand that at time one is in a desperate situation, but you are not very straight forward. A private message without new information does not aid your search nor gives you a more personalized attention. To test on a Win 2000 and give you something tested is really personalized. Unless you provide more information, I believe no one can give you better aid.If you are not a "coder", then say it. You may then be properly directed. Maybe. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. 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