Advertisement
npocmaka

binaryToInt64

May 15th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*&cls
  2. @echo off
  3. rem convert binary to 64bit integers
  4.  
  5. rem --  this will compile .mof stuff bellow goto :eof --
  6. if "%~1"=="" echo %~n0 binary_number&&exit /b 0
  7. if "%~1"=="/?" echo %~n0 binary_nmber&&exit /b 0
  8. setlocal
  9. for /f "delims=10" %%P in ("%~1") do (
  10.     if "%%P" neq "" (
  11.         echo '%~1' is not a binary number
  12.         exit /b 1
  13.     )
  14. )
  15.  
  16. mofcomp  %~dpf0 >nul
  17. del /s /q %temp%\64instance.mof  >nul 2>&1
  18. rem ---------------------------------
  19. echo #pragma namespace("\\\\.\\root\\cimv2") >%temp%\64instance.mof
  20. echo instance of Integer64 { >>%temp%\64instance.mof
  21. echo    INT64 = %~1B; >>%temp%\64instance.mof
  22. echo }; >>%temp%\64instance.mof
  23. rem --------------------------------
  24. mofcomp "%temp%\64instance.mof">nul
  25. del /s /q %temp%\64instance.mof>nul
  26.  
  27.  
  28.  
  29. for /f "tokens=2 delims==" %%N in ('WMIC Path Integer64 get /format:list') do (
  30.     set "number=%%N"
  31. )
  32. echo %number%
  33. wmic  Path Integer64 where INT64=%number% delete >nul
  34. endlocal
  35. goto :eof
  36.  
  37. */
  38.  
  39. #pragma namespace("\\\\.\\root\\cimv2")
  40. //need this to made changes permanent
  41. //#PRAGMA AUTORECOVER
  42.  
  43. class Integer64
  44. {
  45.     [Key] Uint64 INT64;
  46.  
  47. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement