How to get around the 2047 characters CMD string limitation
#23
Posted 08 March 2013 - 06:39 AM
http://technet.micro...y/ee198928.aspx
http://msdn.microsof...0(v=vs.85).aspx
What is available should be:
Quote
Win32_TimeZone
Win32_SystemTimeZone
Windows XP
Win32_TimeZone
Win32_SystemTimeZone
Win32_UTCTime
Win32_CurrentTime
Win32_LocalTime
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
jaclaz
#24
Posted 11 March 2013 - 12:35 AM
Date:
Time:
Cheers and Regards
#25
Posted 11 March 2013 - 03:27 AM
bphlpt, on 11 March 2013 - 12:35 AM, said:
They must be VERY different from the ones in the link I gave in post #19
http://www.msfn.org/...ost__p__1032424
Seriously
Nesting the IF's with IF/ELSE?
jaclaz
This post has been edited by jaclaz: 11 March 2013 - 03:27 AM
#26
Posted 11 March 2013 - 09:25 AM
Cheers and Regards
This post has been edited by bphlpt: 11 March 2013 - 09:26 AM
#27
Posted 11 March 2013 - 10:38 AM
bphlpt, on 11 March 2013 - 09:25 AM, said:
Yep
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_
jaclaz
#28
Posted 11 March 2013 - 02:33 PM
#29
Posted 11 March 2013 - 08:01 PM
2000 + CMD.exe(2000)
Microsoft Windows 2000 [Version5.0.2195]
2000 + CMD.exe(XP)
Microsoft Windows XP [Version5.0.2195]
XP + CMD.exe(XP)
Microsoft Windows XP [Version5.1.2600]
#30
Posted 12 March 2013 - 03:40 AM
allen2, on 11 March 2013 - 02:33 PM, said:
Yep, but the point (mine) was to not use external programs.
There is also a debug script, that should work on 2K as well:
http://www.robvander...e.com/debug.php
Now, Today and Todaynow
jaclaz
#31
Posted 12 March 2013 - 03:37 PM
#32
Posted 13 March 2013 - 04:45 AM
allen2, on 12 March 2013 - 03:37 PM, said:
Yes, of course
http://reboot.pro/to...closed/?p=21795
for the little uses I need (which are usually connected to "dynamically produce some hex bytes).
I am really "old school"
jaclaz
#33
Posted 17 April 2013 - 09:12 AM
jaclaz, on 08 March 2013 - 06:39 AM, said:
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
#34
Posted 17 April 2013 - 09:45 AM
#35
Posted 17 April 2013 - 11:01 AM
#36
Posted 17 April 2013 - 12:25 PM



Help


Back to top









