Jump to content

exe run error


Recommended Posts

This is not happening all the time - sometimes I get this error when I start the exe, sometimes I get the error when the time is due for action.

Here is the script:

#include <GUIConstantsEx.au3>

AutoItSetOption("GUIOnEventMode", 1)
AutoItSetOption("RunErrorsFatal", 0)
AutoItSetOption ("TrayIconDebug", 1)
HotKeySet("+!q", "ExitF")

While 1
    $mins = @MIN
    If Mod($mins, 5) = 0 Then
        RunAsSet("spectrum", @ComputerName, "spectrum")
        Run("D:\win32app\T_Sched_Repl\replacer.exe")
        Sleep(20000)
        If ProcessExists ("replacer.exe") Then 
            ProcessClose("replacer.exe")
            If FileExists(@ScriptDir&"\error.log") Then
                $error_log = FileOpen(@ScriptDir&"\error.log", 1)
            Else
                $error_log = FileOpen(@ScriptDir&"\error.log", 2)
            EndIf
            FileWriteLine($error_log, @MDAY&"/"&@MON&"/"&@YEAR&"_"&@HOUR&":"&@MIN&" Replacer.exe closed forecefully")
            FileClose ($error_log)
        EndIf
        RunWait(@ComSpec & " /c " & 'D:\win32app\SPECTRUM\WebApps\Report_Gateway\SRG\srg.exe', "D:\win32app\SPECTRUM\WebApps\Report_Gateway\SRG", @SW_HIDE)
        Sleep(60000)
    EndIf
    Sleep(500)
WEnd

Func ExitF()
    Exit
EndFunc

and here is the error:

post-18882-1210653541_thumb.jpg

What might be wrong?

Thank you,

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

  • Moderators

Did you run error checking through SciTE?

Did you check your Opts to see if they still existed in the version you are using (We don't know what version).

Did you try to debug via filewrite/console to find out what function it might be referring to?

Did you try to change the name of your Exit function to something else other than ExitF?

Now that I have the obvious questions out of the way... Where is the rest of the script (can't imagine you throwing in Opts for no reason), and what version are you using?

Edited by SmOke_N

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.

Link to comment
Share on other sites

Did you check your Opts to see if they still existed in the version you are using (We don't know what version).

That was what I was thinking. From the Beta history in the help file:

3.2.11.0 (25th January 2008) (Beta)

- Removed: RunErrorsFatal Option.

- Removed: RunAsSet().

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Sorry for not specifying my AutoIT version, I should have thought of that.

I'm running 3.2.11.1 Beta installed on top of 3.2.10.0

- error check on SciTe was fine

- the help file showed that all these commands (I assume that they are still in use) ... however, the help file call from SciTe returns the version 3.2.10.0 (which is not the beta version I have)

- haven't tried the console debug ... the reason was the script was running fine, I only had troubles using the exe file

- my exit function is always called ExitF

I don't know, I'm still confused about this "Beta" thing; I know there are different way to run a Beta and a regular script, but, when I'm using Aut2exe, it will compile the script according to "Beta" or to "Stable Release" ?

And ... this is all the script. That GUIOnEventMode option was just left there because the script first had a GUI (not anymore).

Thanks for help, I will get the latest version installed and I will rewrite the script; it's only a couple lines long after all.

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

Sorry for not specifying my AutoIT version, I should have thought of that.

I'm running 3.2.11.1 Beta installed on top of 3.2.10.0

- error check on SciTe was fine

- the help file showed that all these commands (I assume that they are still in use) ... however, the help file call from SciTe returns the version 3.2.10.0 (which is not the beta version I have)

- haven't tried the console debug ... the reason was the script was running fine, I only had troubles using the exe file

- my exit function is always called ExitF

I don't know, I'm still confused about this "Beta" thing; I know there are different way to run a Beta and a regular script, but, when I'm using Aut2exe, it will compile the script according to "Beta" or to "Stable Release" ?

And ... this is all the script. That GUIOnEventMode option was just left there because the script first had a GUI (not anymore).

Thanks for help, I will get the latest version installed and I will rewrite the script; it's only a couple lines long after all.

In SciTE, F5 runs the script with Prod, and Alt-F5 runs with Beta. F7 compiles with Prod, and Alt-F7 compiles with Beta. As for the help file, I open it with a script that just opens the most recent one (Prod or Beta):
; Open stuff for an AutoIt session

#include <Date.au3>

; Open Scripts folder
Global $sScripts = "C:\Program Files\AutoIt3\Scripts"
ShellExecute($sScripts, "", "", "", @SW_MINIMIZE)

; Determine if Prod or Beta help file is more current
Global $sHelpFile = "AutoIt.chm"
Global $sAutoItKey = "HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt"

Global $sProdValue = "InstallDir"
Global $sProdDir = RegRead($sAutoItKey, $sProdValue)
Global $sProdHelp = $sProdDir & "\" & $sHelpFile
Global $sCurrentHelp = $sProdHelp; Prod help by default
Global $avProdDate = FileGetTime($sProdHelp, 0, 0)

Global $sBetaValue = "BetaInstallDir"
Global $sBetaDir = RegRead($sAutoItKey, $sBetaValue)
Global $sBetaHelp = $sBetaDir & "\" & $sHelpFile
Global $avBetaDate = FileGetTime($sBetaHelp, 0, 0)

For $n = 0 To 5
    If $avProdDate[$n] < $avBetaDate[$n] Then
    ; Beta is newer
        $sCurrentHelp = $sBetaHelp
        ExitLoop
    ElseIf $avProdDate[$n] > $avBetaDate[$n] Then
    ; Prod is newer
        ExitLoop
    Else
    ; Dates match so far...
        ContinueLoop
    EndIf
Next

; Open most recent help file
ShellExecute($sCurrentHelp, "", "", "Open", @SW_MINIMIZE)

; Open SciTE editor
Global $sSciTEKey = "HKEY_CLASSES_ROOT\Applications\SciTE.exe\shell\Edit\Command"
Global $sSciTEExe = StringReplace(RegRead($sSciTEKey, ''), ' "%1"', ''); Default value
If ProcessExists("SciTE.exe") = 0 Then ShellExecute($sSciTEExe, '', '', '', @SW_MINIMIZE)

; Open AutoIt Forum
$sAuotItForumURL = "http://www.autoitscript.com/forum"
ShellExecute($sAuotItForumURL)

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...