- 帖子
- 19
- 积分
- 32
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2014-10-27
|
[文本处理] office 2013裝在d.e.f.g盤找不到路徑腳本,求解
@echo off
title 測試用
setlocal enabledelayedexpansion
echo Administrator > %WINDIR%\System32\Administrator.txt
if not exist %WINDIR%\System32\Administrator.txt goto :exit
del /s /f /q %WINDIR%\System32\Administrator.txt > nul
PUSHD %~dp0&setlocal enabledelayedexpansion
cls
color 0F
echo.
echo. 1. 導入已激活Office2013密鑰+(48位id)
echo.
set /p c=請選擇 1,按「回車」確認:
if %c%==1 goto :ManuallyOffice
:ManuallyOffice
cls
color 0F
@echo.
@echo.
reg query "HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Word\Options" /v "PROGRAMDIR" >> type.txt
for /f "delims=" %%j in ('findstr "REG_SZ" .\type.txt') do set b=%%j&call set drv=%%b:~28,42%%
if exist type.txt del type.txt /q
@echo 導入已激活Office2013密鑰+(48位id)
@echo.
@echo (複製office 2013密鑰在粘貼回車如):XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
set /p key=請輸入office 2013密鑰(複製密鑰在此粘貼回車):
echo office 2013 安裝路徑: %drv%
echo 查看安裝ID
cscript "%drv%\OSPP.VBS" /inpkey:%key%
cscript "%drv%\OSPP.VBS" /act >> Office15key_ID.txt
cscript "%drv%\OSPP.VBS" /dinstid >> Office15key_ID.txt
@echo Office密鑰:%key% >> Office15key_ID.txt
echo 查詢到(9組共63位安裝ID)
cscript "%ProgramFiles%\Microsoft Office\OFFICE15\ospp.vbs" /dinstid
@echo 輸入(48位激活ID)不要有空格如:111111222222333333444444555555666666777777888888
set /p ID=複製電話激活48位激活ID粘貼回車:
cscript "%ProgramFiles%\Microsoft Office\OFFICE15\ospp.vbs" /actcid:%ID%
echo 開始激活
cscript "%ProgramFiles%\Microsoft Office\OFFICE15\ospp.vbs" /act
echo 已複製到當前目錄請查看Office2013查看激活狀態.txt文檔
cscript "%ProgramFiles%\Microsoft Office\OFFICE15\ospp.vbs" /dstatus>> Office2013查看激活狀態.txt
@echo 密鑰:%key% >> Office2013查看激活狀態.txt
echo 8組激活ID: %ID%>> Office2013查看激活狀態.txt
echo 請記住激活後的備份,8組激活ID和key備份,下次系統重裝時還能用回>> Office2013查看激活狀態.txt
echo.
timeout 10
pause |
|