Jump to content

AS/400 and SAP AutoIT script automation


Recommended Posts

I'm new to using AutoIT, and I was wondering how I can open an AS/400 window on an XP SP2 machine (English Version). When trying to open either the AS/400 window or the SAP window I get the following error message:

Line 25 (File "C:\Program Files\AutoIt3\Examples\Test\Test.au3"):

Run("zeridata.sap","C:\Users\marshsep\Desktop")

Error: Unable to execute the external program.

The system cannot find the file specified."

$answer = MsgBox(4, "AutoIt Test", "This is a test script.  Run?")


; Check the user's answer to the prompt (see the help file for MsgBox return values)
; If "No" was clicked (7) then exit the script
If $answer = 7 Then
    MsgBox(0, "AutoIt", "OK.  Bye!")
    Exit
EndIf


; Run IAS
Run("ZERIDATA.sap","C:\Users\marshsep\Desktop")

; Prompt the user to run the script - use a Yes/No prompt (4 - see help file)
$answer = MsgBox(4, "AutoIt Test", "This is a test script.  Run?")


; Check the user's answer to the prompt (see the help file for MsgBox return values)
; If "No" was clicked (7) then exit the script
If $answer = 7 Then
    MsgBox(0, "AutoIt", "OK.  Bye!")
    Exit
EndIf


; Run IAS
Run("ias.wda","C:\Program Files\WallData\")

Please let me know if I need to provide any more information. I greatly appreciate any help available. Thank you.

Link to comment
Share on other sites

Instead of using Run () to a .sap file, try doing the following:

Run (@ComSpec & " /C START " & "ZERIDATA.SAP", "C:\Users\marshsep\Desktop", @SW_HIDE);

This will run a hidden console with a START command. And that will start the .sap file. You can't use Run on it because it's not executable.

[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

Link to comment
Share on other sites

Thank you very much! That worked for both the SAP and AS/400 applications. Thank you!!

One more question though, I noticed that if I wanted to type something into the AS/400 screen I could not use SEND(), any other suggestions? I greatly thank you for your time.

Edited by Kujp Sucisv
Link to comment
Share on other sites

Perhaps you could try getting the control name using the AutoIt Window Info tool. Then using ControlSend to send keystrokes to that control.

[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

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