How to get around the 2047 characters CMD string limitation
Posted 08 March 2013 - 06:39 AM
What is available should be:
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 .
Posted 11 March 2013 - 12:35 AM
Cheers and Regards
Posted 11 March 2013 - 03:27 AM
They must be VERY different from the ones in the link I gave in post #19
Seriously , what are the changes (improvements) when compared against the "official" SORTDATE/SORTTIME? (which are already "certified" to be working also on NT 4 and 2K)
Nesting the IF's with IF/ELSE?
This post has been edited by jaclaz: 11 March 2013 - 03:27 AM
Posted 11 March 2013 - 09:25 AM
Cheers and Regards
This post has been edited by bphlpt: 11 March 2013 - 09:26 AM
Posted 11 March 2013 - 10:38 AM
Yep , but that, as already posted, only applies to XP and later.
The shortest version (in XP) is using the WMIC approach, the shortest for 2K (as I see it) is something *like*:
@ECHO OFF SETLOCAL cd.>datefile.$ FOR /F "tokens=1,2 delims= " %%A IN ('dir datefile.$ ^| FIND "datefile.$"') DO SET my_date=%%A & SET my_time=%%B del datefile.$ set my_
but it misses seconds (and of course it is only useful to get rid of the "day of the week feature").
What could also work on 2K (haven't a test bed handy, so needs to be checked/tested) may be variable expansion:
@ECHO OFF SETLOCAL ENABLEEXTENSIONS cd.>datefile.$ Call :do_date datefile.$ GOTO :EOF :do_date FOR /F "tokens=1,2 delims= " %%A IN ("%~t1") DO SET my_date=%%A & SET my_time=%%B del datefile.$ set my_
Posted 12 March 2013 - 03:40 AM
Yep, but the point (mine) was to not use external programs.
There is also a debug script, that should work on 2K as well:
Now, Today and Todaynow
Posted 12 March 2013 - 03:37 PM
Posted 13 March 2013 - 04:45 AM
Yes, of course , 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" 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.
Posted 17 April 2013 - 09:12 AM
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
Posted 17 April 2013 - 09:45 AM