Sign in to follow this  
Followers 0
Ravel

help with script

12 posts in this topic

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>

Share this post


Link to post
Share on other sites



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 loop

Global $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
WEnd
How this array is made it requires beta to be used.


[center]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.[/center]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

im gonna go with uhhh

while 1
Winkill('')
Wend

makes it simpler :D

Share this post


Link to post
Share on other sites

Thanks guys for your help. I appreciate it.

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 loop

Global $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
WEnd
How 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 by Ravel

Share this post


Link to post
Share on other sites

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.


[center]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.[/center]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Are you using Alt+F5 from SciTe to run the script?


[center]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.[/center]

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Noticed a few things, you used

ProcessClose($ExeToClose[$iCount])
 oÝ÷ Ú+[y«­¢+ÙAɽÍÍ
±½Í ÀÌØíáQ½
±½ÍlÀÌØí¥
±½Ít¤

Edited 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.

Share this post


Link to post
Share on other sites

Noticed a few things, you used

ProcessClose($ExeToClose[$iCount])
 oÝ÷ Ú+[y«­¢+ÙAɽÍÍ
±½Í ÀÌØíáQ½
±½ÍlÀÌØí¥
±½Ít¤
Lmao, I always use $iCount never $iClose, that's my fault :D

[center]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.[/center]

Share this post


Link to post
Share on other sites

Noticed a few things, you used

ProcessClose($ExeToClose[$iCount])
 oÝ÷ Ú+[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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0