Sign in to follow this  
Followers 0
MDCT

AutoIt vs cmd.exe (Efficiency)

3 posts in this topic

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

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