maximum command length in Windows Scheduler

  • Thread starter Thread starter rpremuz@yahoo.com
  • Start date Start date
R

rpremuz@yahoo.com

Guest
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/
 
Re: maximum command length in Windows Scheduler

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.

--
Gary S. Terhune
MS-MVP Shell/User
www.grystmill.com

<rpremuz@yahoo.com> wrote in message
news:1186073100.208242.293010@x35g2000prf.googlegroups.com...
> 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/
>
 
Re: maximum command length in Windows Scheduler


<rpremuz@yahoo.com> wrote in message
news:1186073100.208242.293010@x35g2000prf.googlegroups.com...
> 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.
 
Re: maximum command length in Windows Scheduler

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:"

"Pegasus (MVP)" <I.can@fly.com> wrote in message
news:OQslp6T1HHA.5360@TK2MSFTNGP03.phx.gbl...
>
> <rpremuz@yahoo.com> wrote in message
> news:1186073100.208242.293010@x35g2000prf.googlegroups.com...
> > 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.
>
>
 
Back
Top