Jump to content

RUN, maximum length of command?


 Share

Recommended Posts

Hi,

i call a program with parameters via RUN(). The number of parameters is variable. At a certain point, the RUN command just stalls...

e.g. "test.exe param1 param2 param3 param4" works, but if i add up to 50 parameters and the command line is getting really long, the RUN command does not work. Is there a maxium length? And maybe any way around it?

Thanks and Regards

This post will be edited again by Polyphem: Tomorrow, 11:55 AM
Link to comment
Share on other sites

Thanks for the reply. Thought about that allready, all quoted. It only has to do with the length? Is there a 256 character limit? The parameters are in a variable. Currently i write the command to a temp .bat and start that. But thats only an imperfect work-around.

This post will be edited again by Polyphem: Tomorrow, 11:55 AM
Link to comment
Share on other sites

  • Moderators

I'm not aware of a limit myself, and I couldn't find it in the docs either.

If this is an AutoIt App, have you looked at possibly $CmdLineRaw? And maybe just parsing from the other app?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Currently i write the command to a temp .bat and start that. But thats only an imperfect work-around.

If the same command runs from a batch file it will run from autoit too.

I will use ConsoleWrite() to double chech the run() syntax.

Ex:

ConsoleWrite('test.exe param1 param2 param3 param4 "param 5" "param 6"' & @CRLF)
Run('test.exe param1 param2 param3 param4 "param 5" "param 6"', @TempDir)
AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Link to comment
Share on other sites

There used to be a limit on the char length of all parameters together. So if StringLen($params) > 512|1024|4048 or what it is today you could possibly be in trouble. Not sure if this applies to XP (or Vista)

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