Jump to content

Converting Batch File to AutoIT


 Share

Recommended Posts

Hello All,

I am brand new to AutoIT, however it looks like exactly what I've been looking for.

At my current job, we need to keep software updated pretty regularly. So, I created a little batch file called "Software Updater" that sits on everyone's desktop and gives them a choice of which software to update.

The desktop "ICON" is just a shortcut to the script that is on a network drive. Right now, it is a DOS window using the choice command.

I would love to have it a Windows GUI. I have been able to figure out how to rewrite the batch files using AutoIT, however, I am not real clear on how to create the actual windows where you would get the choices.

Ideally a simple list of the options, then when ticked off, it starts the process (which, in most cases, is just copying a file to the hard drive and running it from there).

This is what I am trying to duplicate.

Any insight would be appreciated.

Thanks.

====== Welcome to the Software Updater Main Menu =====

Which application would you like to update?

Use your keyboard to choose.

You will be asked to pick your location

before the installation begins.

APPLICATION VERSION

1.App 1 - v20/5

2.App2 - v37.1

3.App3 - v103.06

4.App4 - v103.06

5.App5 - v4.12

9.EXIT

Link to comment
Share on other sites

  • Moderators

Is this a full GUI on the desktop, or a TrayMenu down by the clock? If it is a full GUI, I would start with something like this for your framework:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Local $msg

GUICreate("Test", 300, 300)
GUISetState(@SW_SHOW)

    While 1
        $msg = GUIGetMsg()
   Select
    Case $msg = $GUI_EVENT_CLOSE
     ExitLoop
   EndSelect
    WEnd

GUIDelete()

You can then read through the help file for adding buttons (GUICTrlCreateButton), labels (GUICtrlCreateLabel), etc.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

A lot of different choices there, can just do buttons, put in a radio button, or check boxes and go through each one.

Is there ever a reason why you would not want to update a program? I'd personally try to remove any "to do" for the end user. You could do version checking (FileGetVersion may work if it's not some obscure program). You could also create an ini file for checking server version. Then you could make it on the end user side either automatically update or toss a msgbox up informing them there is an update and ask if they want to do it now. etc...

Anyways, a GUI may not even be needed depending on the end goal. You're no longer limited by a batch file and you have some options now.

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