Advertisement
npocmaka

octalToInt64

May 15th, 2013
89
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 octal_number&&exit /b 0
  7. if "%~1"=="/?" echo %~n0 octal_nmber&&exit /b 0
  8. setlocal
  9. set parameter=%~1
  10. set octal_marker="parameter:~0,1"
  11.  
  12. if "%octal_marker%" neq "0" (
  13.     echo '%~1' is not an octal number
  14.     exit /b 1  
  15. )
  16.  
  17. for /f "delims=01234567" %%P in ("%~1") do (
  18.     if "%%P" neq "" (
  19.         echo '%~1' is not an octal number
  20.         exit /b 1
  21.     )
  22. )
  23.  
  24. mofcomp  %~dpf0 >nul
  25. del /s /q %temp%\64instance.mof  >nul 2>&1
  26. rem ---------------------------------
  27. echo #pragma namespace("\\\\.\\root\\cimv2") >%temp%\64instance.mof
  28. echo instance of Integer64 { >>%temp%\64instance.mof
  29. echo    INT64 = %~1; >>%temp%\64instance.mof
  30. echo }; >>%temp%\64instance.mof
  31. rem --------------------------------
  32. mofcomp "%temp%\64instance.mof">nul
  33. del /s /q %temp%\64instance.mof>nul
  34.  
  35.  
  36.  
  37. for /f "tokens=2 delims==" %%N in ('WMIC Path Integer64 get /format:list') do (
  38.     set "number=%%N"
  39. )
  40. echo %number%
  41. wmic  Path Integer64 where INT64=%number% delete >nul
  42. endlocal
  43. goto :eof
  44.  
  45. */
  46.  
  47. #pragma namespace("\\\\.\\root\\cimv2")
  48. //need this to made changes permanent
  49. //#PRAGMA AUTORECOVER
  50.  
  51. class Integer64
  52. {
  53.     [Key] Uint64 INT64;
  54.  
  55. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement