DSChaos

why give a error? function run

9 posts in this topic

Hi people of autoit world :D , today im here why i have a problem whit a little script.

#RequireAdmin
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <ProgressConstants.au3>
#include <File.au3>
#include <IE.au3>
#include <FTPEx.au3>
#include <MISC.au3>
#include <GUIListBox.au3>
#include <Array.au3>

#pragma compile(AutoItExecuteAllowed, true)


$FLOPP=FileOpen("C:\Force4 Cleaner\plugins-est\file_load.txt")
If $FLOPP=1 Then
   If FileReadLine($FLOPP,1)="START" Then
      _FileCreate("C:\Force4 Cleaner\plugins-est\files.txt")
      $FILES=FileFindFirstFile("C:\Force4 Cleaner\plugins-est\*.plg")
      For $SNIP=1 To 10 Step +1
         $FILES1=FileFindNextFile($FILES)
         If @error Then
            ExitLoop
         Else
            FileWriteLine("C:\Force4 Cleaner\plugins-est\files.txt",$FILES1)
         EndIf
      Next
      For $SNIP2=1 to 10 Step +1
         $FLL=FileReadLine("C:\Force4 Cleaner\plugins-est\files.txt",$SNIP2)
         $FULL="C:\Force4 Cleaner\plugins-est\"&$FLL
         If $FULL="C:\Force4 Cleaner\plugins-est\" Then
            ExitLoop
         Else
            Run("Force4 C.exe"&"/AutoIt3ExecuteScript "&$FULL)
            if @error Then
               MsgBox(48,"Error",@error &" AT: "&$FULL)
            EndIf
         EndIf
      Next
   EndIf
EndIf

i have tryed to found a solutions , but after 10-15 attempts , the script don't work , it will give me at error  (ERROR : 1 ).... i don't know where im wrong.....the code is just , why that error? anyone have a idee for that error?

Share this post


Link to post
Share on other sites



Because you should at least add a space:

Run("Force4 C.exe " & "/AutoIt3ExecuteScript " & $FULL)

 

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

i think who works , but when i tryed to watch if work i received a new messagge of error on this script:

#RequireAdmin
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <ProgressConstants.au3>
#include <File.au3>
#include <IE.au3>
#include <FTPEx.au3>
#include <MISC.au3>
#include <GUIListBox.au3>
#include <Array.au3>

#pragma compile(AutoItExecuteAllowed, true)

$FLOPP=FileOpen("C:\Force4 Cleaner\plugins-est\file_load.txt")
If $FLOPP=1 Then
   If FileReadLine($FLOPP,1)="START" Then
      _FileCreate("C:\Force4 Cleaner\plugins-est\files.txt")
      $FILES=FileFindFirstFile("C:\Force4 Cleaner\plugins-est\*.plg")
      For $SNIP=1 To 10 Step +1
         $FILES1=FileFindNextFile($FILES)
         FileWriteLine("C:\Force4 Cleaner\plugins-est\files.txt",$FILES1)
      Next
      For $SNIP2=1 to 10 Step +1
         $FLL=FileReadLine("C:\Force4 Cleaner\plugins-est\files.txt",$SNIP2)
         MsgBox(0,"1",$FLL)
         $FULL="C:\Force4 Cleaner\plugins-est\"&$FLL
         MsgBox(0,"2",$FULL)
         If $FULL="C:\Force4 Cleaner\plugins-est\" Then
            ExitLoop
         EndIf
         $RUN=Run("Force4 C.exe " & "/AutoIt3ExecuteScript " & $FULL)
         MsgBox(0,"3",$RUN)
         if @error Then
            MsgBox(48,"Error",@error &" AT: "&$FULL)
         EndIf
      Next
   EndIf
EndIf

the error is:

w2jb77.png

and i not know the sense and why that... i already searched for this error on script , and i found where hes start.  In the new script (here up) i put 3 msgbox to watch where the error start and , start after the msgbox n°3 but i don't know why..... anyone know how to resolve it?

Share this post


Link to post
Share on other sites

I think you need to add quotes (didn't test it):

$RUN=Run("Force4 C.exe " & "/AutoIt3ExecuteScript '" & $FULL & "'")

 

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

thanks , but i have another problem (lulz):

$RUN=Run(" Force4 C.exe " & "' /AutoIt3ExecuteScript '" & $FULL & "'")

this is the correct. Now i don't give any tipe of messagge / error , but now....don't work the load of file, it need to execute the script who is in a file , but now it don't work. Now i will try to search a solution , but if you know how to resolve this?

Share this post


Link to post
Share on other sites

Is there really a space in "Force4 C.exe"?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
On 23/2/2016 at 6:21 PM, water said:

Is there really a space in "Force4 C.exe"?

yes , here is a space , now i trying "Force4_c.exe" but don't work :(

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Hi.

 

You will need to qoute the "EXE-with-the-Space-in-its-Name"

 

 

$result=RunWait( '"Force4 C.EXE" /AutoIt3ExecuteScript "further params with spaces"',"C:\some\working\directory",@SW_SHOW)

 

Regards, Rudi.

<edit: typo>

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

Your script misses a FileClose()

See the remarks for FileOpen in the au3 help file.

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