Ravel Posted June 11, 2006 Share Posted June 11, 2006 I have this script that I would like to use for multiple files. I want it to continusouly close files that may open... the script is below. Is there a way I can change it so that it will seek and close more than just one file? Thanks. ; <AUT2EXE VERSION: 3.1.0.4> ; ---------------------------------------------------------------------------- ; <AUT2EXE INCLUDE-START: C:\Documents and Settings\Ravel\Desktop\Scripts\erronous file.au3> ; ---------------------------------------------------------------------------- HotkeySet('{PAUSE}', 'Terminate') while 1 If ProcessExists("sysLOAD_INI.pif") Then ProcessClose("sysLOAD_INI.pif") Endif Sleep (30) Wend Func Terminate() Exit EndFunc ; ---------------------------------------------------------------------------- ; <AUT2EXE INCLUDE-END: C:\Documents and Settings\Ravel\Desktop\Scripts\erronous file.au3> Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 11, 2006 Moderators Share Posted June 11, 2006 I'm not understanding why or what you need to be honest... so this is a guess at best... create an array of the files you want to close, then loop through them with For/Next within the While/WEnd loopGlobal $ExeToClose[4] = ['', 'NotePad.exe', 'MsPaint.exe', 'Calc.exe'] While 1 For $iClose = 1 To UBound($ExeToClose) - 1 If ProcessExists($ExeToClose[$iClose]) Then ProcessClose($ExeToClose[$iCount]) Next WEndHow this array is made it requires beta to be used. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Xenobiologist Posted June 11, 2006 Share Posted June 11, 2006 HI, HotkeySet('{PAUSE}', 'Terminate') Global $files[6] = ["", "sysLOAD_INI.pif", "", "", "", ""] while 1 For $i = 1 To UBound($files)-1 If ProcessExists($files[$i]) Then ProcessClose($files[$i]) Next Sleep (30) Wend Func Terminate() Exit(0) EndFunc So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted June 11, 2006 Share Posted June 11, 2006 im gonna go with uhhh while 1 Winkill('') Wend makes it simpler Link to comment Share on other sites More sharing options...
Ravel Posted June 11, 2006 Author Share Posted June 11, 2006 Thanks guys for your help. I appreciate it. Link to comment Share on other sites More sharing options...
Ravel Posted June 11, 2006 Author Share Posted June 11, 2006 (edited) I'm not understanding why or what you need to be honest... so this is a guess at best... create an array of the files you want to close, then loop through them with For/Next within the While/WEnd loopGlobal $ExeToClose[4] = ['', 'NotePad.exe', 'MsPaint.exe', 'Calc.exe'] While 1 For $iClose = 1 To UBound($ExeToClose) - 1 If ProcessExists($ExeToClose[$iClose]) Then ProcessClose($ExeToClose[$iCount]) Next WEndHow this array is made it requires beta to be used. K i am trying to use this particular script but i keep getting the following message: Line 3 (File "C:\Documents and Settings\Ravel\Desktop\Scripts\Multi file erroneous close loop.au3"): Global $files[2] = ['aolsoftware.exe', 'cdf3c22f.exe'] Global $files[2] ^ ERROR Error: No variable given for "Dim", "Local", "Global" or "Const" statement. anyone have any idea why? Because I have no idea what this means...even after checking the help file. Edited June 11, 2006 by Ravel Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 11, 2006 Moderators Share Posted June 11, 2006 As I said, you need BetaAlso, I'm using 1 to whatever, no 0 to whatever, so the first parameter must look like: ['', << that not like ['aolsoftware.exe' << that. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Ravel Posted June 11, 2006 Author Share Posted June 11, 2006 As I said, you need Beta Also, I'm using 1 to whatever, no 0 to whatever, so the first parameter must look like: ['', << that not like ['aolsoftware.exe' << that. k thanks. I got the beta upgrade, and the script will run but it will not close anything. Did i miss something in the script? Here is how i have it written: HotkeySet('{PAUSE}', 'Terminate') Global $ExeToClose[2] = ['notepad.exe', 'cdf3c22f.exe'] While 1 For $iClose = 1 To UBound($ExeToClose) - 1 If ProcessExists($ExeToClose[$iClose]) Then ProcessClose($ExeToClose[$iCount]) Next Sleep (50) WEnd Func Terminate() Exit EndFunc Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 11, 2006 Moderators Share Posted June 11, 2006 Are you using Alt+F5 from SciTe to run the script? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
RazerM Posted June 11, 2006 Share Posted June 11, 2006 (edited) Noticed a few things, you used ProcessClose($ExeToClose[$iCount]) oÝ÷ Ú+lç[y«¢+ÙAɽÍÍ ±½Í ÀÌØíáQ½ ±½ÍlÀÌØí¥ ±½Ít¤ Edited June 11, 2006 by RazerM My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 11, 2006 Moderators Share Posted June 11, 2006 Noticed a few things, you used ProcessClose($ExeToClose[$iCount]) oÝ÷ Ú+lç[y«¢+ÙAɽÍÍ ±½Í ÀÌØíáQ½ ±½ÍlÀÌØí¥ ±½Ít¤Lmao, I always use $iCount never $iClose, that's my fault Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Ravel Posted June 11, 2006 Author Share Posted June 11, 2006 Noticed a few things, you used ProcessClose($ExeToClose[$iCount]) oÝ÷ Ú+lç[y«¢+ÙAɽÍÍ ±½Í ÀÌØíáQ½ ±½ÍlÀÌØí¥ ±½Ít¤oÝ÷ ٩ݶ¢¹ÞÆÙh¢-j»ljÝ[ºÛayªëk+-j»ljݺÚ"µÍÝÙ^TÙ] ÌÎNÞÔUTÑ_IÌÎNË ÌÎNÕZ[]IÌÎNÊBÛØ[ ÌÍÑ^UÐÛÜÙVÌHHÉÌÎNÛÝY^IÌÎNË ÌÎNÛÜZ[^IÌÎN×BÚ[HBÜ ÌÍÚPÛÜÙHHÈPÝ[ ÌÍÑ^UÐÛÜÙJHHBYØÙÜÑ^ÝÊ ÌÍÑ^UÐÛÜÙVÉÌÍÚPÛÜÙWJH[ØÙÜÐÛÜÙJ ÌÍÑ^UÐÛÜÙVÉÌÍÚPÛÜÙWJB^ÛY L BÑ[[ÈZ[]J B^][[ That was it. THat fixed the problem. Thanks again for you alls help. 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