maximum command length in Windows Scheduler

R

rpremuz

Hello,

I have a question for a MS MVP.

What is the maximum length of a command that you can put in a Windows
scheduled task (its run field)?

E.g. http://support.microsoft.com/kb/830473/en-us
gives command-line string limitations for various versions of MS
Windows but does not tell anything about the Windows Scheduler.

-- rpr. /Robert Premuz/
 
G

Gary S. Terhune

Can't say with absolute certainty, but as that article has the same figures
for all the examples -- "...either 2047 or 8191 characters (as appropriate
to your operating system)" -- I would assume those figures also apply to a
command for Scheduled Tasks. Only other figure I could imagine would be 255
or 256 characters, but I just created a scheduled task with a command 270
characters long and it ran just fine.
 
P

Pegasus \(MVP\)

Hello,

I have a question for a MS MVP.

What is the maximum length of a command that you can put in a Windows
scheduled task (its run field)?

E.g. http://support.microsoft.com/kb/830473/en-us
gives command-line string limitations for various versions of MS
Windows but does not tell anything about the Windows Scheduler.

-- rpr. /Robert Premuz/

What would be the point of having a command line that exceeds
a few hundred characters? It would be totally unmanageable! If
you really want to find out then you can do so quite easily, by
scheduling this command to run:

cmd /c echo 1234567890x

Now double the numerical string time and again and check
how long it takes until the trailing "x" disappears. The test may
be tedious (and IMHO futile) but it will give you an authoritative
answer.
 
C

Chuck

Somewhere in the past, along with the long file and folder names, the buffer
for command lines got larger.
Long folder names several layers deep plus a long file name or two can
easily fill a very large command line buffer.

"What would be the point of having a command line that exceeds
a few hundred characters? It would be totally unmanageable! If
you really want to find out then you can do so quite easily, by
scheduling this command to run:"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top