本帖最后由 aa77dd@163.com 于 2016-10-17 23:35 编辑
- @echo off & setlocal EnableDelayedExpansion
- <SN.txt set /p "p="
- set "Q=#%p%"
- echo;%p%
- set "newSN="
- set "JW=1"
- for /L %%i in (-1 -1 -50) do (
-
- if not "!Q:~%%i,1!"=="#" (
-
- if !JW!==0 (
- set "newSN=!Q:~%%i,1!!newSN!"
- ) else (
- set /a "bit=0x!Q:~%%i,1! + JW, JW=^!(bit-16)"
-
- cmd /c exit /b !bit!
-
- set "newSN=!=exitcode:~-1!!newSN!"
- )
- )
-
- )
- echo;newSN:&echo;!newSN!
- (>SN.txt echo;!newSN!)
- pause
- exit
复制代码
|