Sign in to follow this  
Followers 0
slayerz

can anybody fix my loop?

3 posts in this topic

#NoTrayIcon
Opt("WinTitleMatchMode", 2)

While 1
    If  ProcessExists("login.exe") Then
         ProcessClose("denied.exe")
         ExitLoop
    Else
    continueloop
    EndIf

    If WinExists("E:\~slayerz_blad3~", "") Then
        WinClose("E:\~slayerz_blad3~", "")
          ElseIf WinExists("F:\~slayerz_blad3~", "") Then
        WinClose("F:\~slayerz_blad3~", "")
          ElseIf WinExists("G:\~slayerz_blad3~", "") Then
        WinClose("G:\~slayerz_blad3~", "")
          ElseIf WinExists("H:\~slayerz_blad3~", "") Then
        WinClose("H:\~slayerz_blad3~", "")
          ElseIf WinExists("I:\~slayerz_blad3~", "") Then
        WinClose("I:\~slayerz_blad3~", "")
    EndIf
    If WinExists("Windows Task Manager", "") Then
       WinKill("Windows Task Manager", "")
    EndIf
    If WinExists("Format ~sLaYeRz_bLaD3~", "") Then
        WinClose("Format ~sLaYeRz_bLaD3~", "")
        MsgBox(16, "WaRnInG! Violation Detected!", "HoW DaRe YoU tO fOrMaT mY DaTa???",3)
    EndIf   
WEnd
i'd made this script to protect m pendrive from any user that not asking for my permission (my frenz alwiz do that)!

so, i'd another script that will prompt for password when the user double left-click on my pendrive.

but, the application won't work if the right-click and OPEN or EXPLORE.

that's why i made this script to prevent them from entering my pendrive w/out correct password.

when the correct password entered, login.exe will run & close the denied.exe process.

the reason i also kill the process of task manager is to prevent the user from terminate this script.

the problem is, this application uses too much RAM memory and the buffer will maintain 100%!

could anyone fix this script 4me?thanks


AUTOIT[sup] I'm lovin' it![/sup]

Share this post


Link to post
Share on other sites



A simple sleep properly positioned usually will solve most issues of CPU Usage. Try putting a Sleep(10) right after your While 1 and before your If ProcessExists() statement.


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.

Share this post


Link to post
Share on other sites

A simple sleep properly positioned usually will solve most issues of CPU Usage. Try putting a Sleep(10) right after your While 1 and before your If ProcessExists() statement.

thanks SmOke_N for ur help!

AUTOIT[sup] I'm lovin' it![/sup]

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