Sign in to follow this  
Followers 0
trids

Limits on $CmdLine?

3 posts in this topic

Are there any limits to the number of parameters that $CmdLine accepts?

I compiled the script below several versions ago .. and recently when trying to pass 50 or so files to it, only about 5 to 10 landed on the clipboard. And the last line was not whole. A different selection of files yielded similar results. Always a total of approx 200 bytes.

Then I cleverly recompiled it with 3.0.86 .. but got similar results. Except now the total is around 400 bytes.

Any ideas why I can't get all the files I select?

TIA

ClipCopy.au3

;This script is meant to run as the destination EXE 
;for a rightclick -> SendTo operation.
; - It's purpose is to place on the clipboard the names fo the files that were sent to it.
; - SPACE delimited and QUOTED list is compatible with TextPad's File/Open dialog.
; - CRLF-delimited list is nice for text listings and documentation


If $CmdLine[0] > 0 Then
    $tmp = ""
    For $i = 1 to $CmdLine[0]
;SPACE-delimited and QUOTED..
;        $tmp =  $tmp & """" & FileGetLongName($CmdLine[$i]) & """ "
;
;CRLF-delimited..
        $tmp =  $tmp & FileGetLongName($CmdLine[$i]) & @CRLF
    Next
    ClipPut(StringTrimRight($tmp,1))
EndIf

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I believe there is a limit on the total command line length. I don't know for sure on this, but they had a bug in several microsoft programs in the past due to this.

IE for example used to crash the webservers if you just added 257 characters after the webaddress.

I don't know for sure like i said, and I am testing this out to see the length that causes the error.

So far my testing shows anything under 1950 in length. Think of this as just a large run statement instead of drag and drop.

btw, if you drop the same ammount of files on wordpad.exe, or any other windows program it will do the same. (does for me)

(any exe file, not into a running program)

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

Oh yea, has nothing to do with you code, compile this and you get same result

; this does nothing

AutoIt3, the MACGYVER Pocket Knife for computers.

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
Sign in to follow this  
Followers 0