Jump to content

AutoIt vs cmd.exe (Efficiency)


MDCT
 Share

Recommended Posts

Hallo guys,

Now my question is about efficiency...

I have made wrapper for an application that write the registry on open and delete registry on close.

With batch (.bat), I use start /wait to wait until the application closed then it will delete the registry.

With AutoIt, I use:

While 1
    Sleep(200)
    If ProcessExists("Application.exe") Then
        Sleep(200)
    Else
        Run("regedit.exe /s Remove-reg.reg")
        Run("Application_Start.exe")
    EndIf
WEnd
(The Application_Start.exe is the script itself... to make the application start again when it is closed, it's not stable sometimes it closes by itself, but I need to have it automatically re-run when closed.)

Using AutoIt, it takes around 4,000 kb RAM and 1% CPU every few seconds, while using batch (start /wait) it takes around 1,800 kb and 0% CPU, can somebody confirm this? (I did try to use ProcessWaitClose() but it takes more CPU.) Or maybe it is possible for my script above to be improved so it will always use CPU 0%?

And.. the problem when using batch (start /wait) is it displays cmd.exe in the Task Manager which will surely make confusion if I use command-line or have many like this, is there any work around or solution for this?

Thank you for any help, suggestion, or input.

Link to comment
Share on other sites

4,000kb seems high, you ran a compiled script right?

UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Link to comment
Share on other sites

4,000kb seems high, you ran a compiled script right?

Yes, I run it as exe. There are scripts before the loop that determine if the process is closed or not... the script is to prevent double script (If UBound(ProcessList(@ScriptName)) > 2 then); close if the application is already exists; adding setting registry.

But even if I only use only the script I posted, it still takes around 4,000 kb.

I'm using AutoIt non-install (the zip version), Windows XP SP2.

Edited by MDCT
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...