Jump to content

How to get around the 2047 characters CMD string limitation


Recommended Posts

Posted

Never needed to use this means but if you go this way then you could also use something like the method used by Herbert Kleebauer there or like explained there to put any needed executable in the batch as some resource that would be extracted/decoded before being used.


Posted

Never needed to use this means but if you go this way then you could also use something like the method used by Herbert Kleebauer there or like explained there to put any needed executable in the batch as some resource that would be extracted/decoded before being used.

Yes, of course :thumbup , though I personally tend to to use the simpler ECHOO.COM (also by Herbert Kleebauer):

for the little uses I need (which are usually connected to "dynamically produce some hex bytes).

I am really "old school" :ph34r: but I really see no issues in having an external tool and - whenever possible/advisable - I try not to "embed" anything inside "anything else", in which case the so-called "batch compilers" (which mostly - but not all ) do nothing but package the batch and the needed tools into a SFX archive, seem to me a better choice.

jaclaz

  • 1 month later...
Posted

For 2K (but also for XP if one wants to have the date/time format in the "full" UTC format), writing a file and immediately get it's created or last accessed time/date may be a good enough workaround :unsure:.

How about this as a workaround?

CD.>temp
cabarc n temp._ temp
FOR /F "skip=9 tokens=3-8 delims=/: " %%A IN ('cabarc l temp._') DO ECHO %%A%%B%%C.%%D%%E%%F

The result is same as using

date.exe +%%Y%%m%%d.%%H%%M%%S

Posted

How about this as a workaround?

Which advantage has it when compared to the snippet in post #27 (that needs not cabarc or *any* external program)? :unsure:

The issue is that you need to create a file (in your case TWO of them).

jaclaz

Posted

The advantage is that you also get seconds and that it's completely locale independent (you get hours in the 24-hour format).

Posted

The advantage is that you also get seconds and that it's completely locale independent (you get hours in the 24-hour format).

Ah, well. :)

jaclaz

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...