Jump to content

Error: Subscript used on non-accessible variable


sebus
 Share

Go to solution Solved by Musashi,

Recommended Posts

Using this code:

#include <File.au3>
#Include <Array.au3>

Global $IsPE = StringInStr(@SystemDir, "X:")


$aFiles = _FileListToArrayRec(@ScriptDir, "*.inf", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH)

For $i = 1 To $aFiles[0]
    $Command = 'drvload "' & $aFiles[$i] & '"'
    ConsoleWrite(@CRLF & $Command)
    If $IsPE Then Run(@ComSpec & " /c " & $Command, @SystemDir)
Next

 

But getting the error

Line 11 (File "X:\Helper\PEAutoRun\Drivers\main.au3):
.
.
Error: Subscript used on non-accessible variable

 

Any idea what I am missing?

Thanks

sebus

Link to comment
Share on other sites

  • Solution

Insert the following code

If @error Then
    ConsoleWrite("Extended = " & @extended & @CRLF)
    Exit
EndIf

directly behind 

$aFiles = _FileListToArrayRec(@ScriptDir, "*.inf", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH)

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

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