Jump to content

[fixed] RunWait("filename") limitation


Recommended Posts

Is there a maximum limitation for filename's lenght parameter in the RunWait() function?

RunWait ( "filename" [, "workingdir" [, flag]] )
I would guess it is set by the environmental variable MAX_PATH which I think is 260 characters. I would expect that it is limited by windows not by AutoIt.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

The Windows limitation for filenames is 255 characters I thought. I was only able to write 214 characters to a filename (excluding the extension). This code will attempt to create the highest possible filename and show you the result:

$file = ""
For $X = 1 to 300
    $file &= "A"
    
    $result = FileWrite($file & ".txt", "TEST")
    
    If $result = 0 Then
        MsgBox(0,"","FAIL at " & $X & " characters")
        Exit
    EndIf
    
    FileDelete($file & ".txt")
Next
Link to comment
Share on other sites

Thanks for replies but this isn't what i'm waiting.

I know the filefullpath limitation for windows is 255 characters.

@weaponx: with your script located in "c:\" it failed at 252 so 251 + 4 ('.txt' lenght) = 255. this confirm the 255 characters limitation for filepath.

I use RunWait() to run executable program with multi parameters and by this way the lenght of my "filename" parameter is more than 255.

I've test this lenght and AutoIt failed to RunWait with more than 4096 characters' lenght.

So i think this AutoIt limitation is define by CMDLINEPARAM_MAXLEN = 4096 in the help

Edited by taz742
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...