Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How to read first 2 bytes of selected file in DOS or command prompt by BAT  (Read 11243 times)

0 Members and 1 Guest are viewing this topic.

MIRKOSOFT

    Topic Starter


    Hopeful

    Thanked: 2
    Now I tried decimal and it works not...
    Where do I mistake?
    I only removed remark from decimal line and added remark to hexadecimal line...

    Miro

    MIRKOSOFT

      Topic Starter


      Hopeful

      Thanked: 2
      Fixed - decimal works too - only removed Hex prefix with correct brackets.

      Miro

      Salmon Trout

      • Guest
      Here's why the decimal output didn't work in the second script...

      REM Decimal or...
      rem echo wscript.echo ASCB(MIDB(buf,1,1)) ^& "," ^& ASCB(MIDB(buf,2,1)) >> 2byte.vbs


      REM Hex
      echo wscript.echo Hex(ASCB(MIDB(buf,1,1))) ^& "," ^& Hex(ASCB(MIDB(buf,2,1))) >> 2bytes.vbs