Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal
- :: Define simple macros to support JavaScript within batch
- set "beginJS=mshta "javascript:close(new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).Write("
- set "endJS=));""
- :: Direct instantiation requires that output is piped
- %beginJS% (new Date()).getTime() %endJS% | findstr "^"
- :: FOR /F does not need pipe
- for /f %%N in (
- '%beginJS%(new Date()).getTime()%endJS%'
- ) do set date_time=%%N
- echo date_time=%date_time%
- endlocal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement