Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for hex2bin_php.bat

(view source code of hex2bin_php.bat as plain text)

  1. @ECHO OFF
  2. :: http://www.robvanderwoude.com/batchphp.php
  3. :: Usage:  "hex2bin 0xF7" or "hex2bin F7" both return "11110111"
  4. SETLOCAL
  5. SET Hex=%~1
  6. IF /I "%Hex:~0,2%"=="0x" SET Hex=%Hex:~2%
  7. PHP -r print(decbin(hexdec(%Hex%)));
  8. ENDLOCAL
  9.  

page last uploaded: 2017-07-06, 12:37