sebus Posted September 22 Share Posted September 22 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 More sharing options...
Solution Musashi Posted September 22 Solution Share Posted September 22 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) sebus 1 "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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now