标题: 500元求助写安装字体程序 [打印本页]
作者: klamelin 时间: 2020-10-13 18:08 标题: 500元求助写安装字体程序
本帖最后由 klamelin 于 2020-10-19 13:26 编辑
我自己开发了几套字体,之前找人写过一个bat,现在想升级下。其实是达到类似目的,但是实现过程完全不一样了。
已完成。
作者: yhcfsr 时间: 2020-10-13 19:49
5,6应该是做不到的,其他的理论上都可以实现.
作者: zaqmlp 时间: 2020-10-13 20:36
本帖最后由 zaqmlp 于 2020-10-13 23:43 编辑
安装- @echo off
-
- set checkdays=20201013 20201014 20201015 20201016
- >"%tmp%\y83j6rf.v" echo;d=date:WSH.echo right(Year(d),4) ^& right("0" ^& Month(d),2) ^& right("0" ^& Day(d),2)
- set f=0
- for /f %%a in ('cscript -nologo -e:vbscript "%tmp%\y83j6rf.v"') do (
- for %%b in (%checkdays%) do (
- if "%%a" equ "%%b" set /a f+=1
- )
- )
- if "%f%" equ "0" (echo;已过期&goto end)
-
- rem 3位字体编号
- set fontcode=467
- (
- echo;list disk
- echo;select disk 0
- echo;detail disk
- echo;exit
- )>"%temp%\d.txt"
- set "diskID="
- for /f "tokens=1* delims=:" %%a in ('diskpart /s "%temp%\d.txt"^|findstr /i /c:"磁盘 ID:" /c:"Disk ID:"') do (
- set "diskID=%%b"
- )
- if not defined diskID (echo;获取机器码失败&goto end)
- set "diskID=%diskID: =%"
- set localcode=%diskID:~-8%%fontcode%
- echo;机器码:%localcode%
-
- set salt=3.1415
- (
- echo;var a=WSH.Arguments^(0^),salt=Number^(WSH.Arguments^(1^)^),s=0;
- echo;var b=a.split^(""^).reverse^(^);
- echo;for^(var i=0;i^<b.length;i++^){s+=b[i].charCodeAt^(^)*salt;}
- echo;WSH.echo^(s.toString^(^).replace^(".","-"^).split^(""^).reverse^(^).join^(""^)^);
- )>"%tmp%\4f9kho.j"
- set "xcode="
- for /f "delims=" %%a in ('cscript -nologo -e:jscript "%tmp%\4f9kho.j" "%localcode%" "%salt%"') do set "xcode=%%a"
- rem echo;%xcode%
- set /p checkcode=请输入授权码:
- if not defined xcode (goto end)
- if "%xcode%" neq "%checkcode%" (echo;授权码错误&goto end)
-
- echo;已授权,开始安装……
- attrib -s -h "%windir%\Fonts"
- cd /d "%~dp0"
- set "exefile1=rar.exe"
- set "exefile2=FontReg.exe"
- if not exist "%exefile1%" (echo;"%exefile1%" 未找到&goto end)
- if not exist "%exefile2%" (echo;"%exefile2%" 未找到&goto end)
- for /f "delims=" %%a in ('dir /a-d/b/s *.rar') do (
- echo;"%%~nxa"
- %exefile1% x -o+ -p"888666" "%%a" >nul 2>nul
- for /f "delims=" %%b in ('dir /a-d/b/s *.ttf') do (
- echo;安装字体"%%~nxb"
- pushd "%%~dpb"
- "%~dp0%exefile2%" /copy
- popd
- rd /s /q "%%~dpb">nul
- )
- )
- attrib +s +h "%windir%\Fonts"
- echo;安装完成
- :end
- echo;请按任意键退出
- pause>nul
- exit
复制代码
作者: zaqmlp 时间: 2020-10-13 20:41
本帖最后由 zaqmlp 于 2020-10-13 23:42 编辑
计算授权码- @echo off
- set /p localcode=请输入机器码:
- if not defined localcode (pause&exit)
- set salt=3.1415
- (
- echo;var a=WSH.Arguments^(0^),salt=Number^(WSH.Arguments^(1^)^),s=0;
- echo;var b=a.split^(""^).reverse^(^);
- echo;for^(var i=0;i^<b.length;i++^){s+=b[i].charCodeAt^(^)*salt;}
- echo;WSH.echo^(s.toString^(^).replace^(".","-"^).split^(""^).reverse^(^).join^(""^)^);
- )>"%tmp%\4f9kho.j"
- set "xcode="
- for /f "delims=" %%a in ('cscript -nologo -e:jscript "%tmp%\4f9kho.j" "%localcode%" "%salt%"') do set "xcode=%%a"
- echo;授权码:%xcode%
- pause
- exit
复制代码
作者: peterboy666 时间: 2020-10-14 16:06
我的看法,
全程用 EXE 程序,不要夹 BAT.
作者: klamelin 时间: 2020-10-14 18:05
回复 4# zaqmlp
好的。我今晚研究下。我加你qq了,想咨询些细节。还有付款。
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |