[BATCH][.vbs] How to get voice to work in batch file?

Discussion in 'Scripting' started by timesurfer, Jan 23, 2011.

  1. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,065
    270
    #1 timesurfer, Jan 23, 2011
    Last edited by a moderator: Apr 20, 2017
    Hi I was thinking it would be funny to get IORRT if no rearms we're detected, to say

    No rearms detected :eek:

    I was looking at MasterDisasters script for volume editions win 7 and office 2010

    and he seemed to do it so I thought maybe I could also. Here's his script

    Code:
    @echo off
    mode con cols=70 lines=7
    title KMS Activation Script for Z.W.T Keygen
    start /B /D "%~dp0" Keygen.exe>NUL 2>&1
    call :windows
    call :office
    taskkill /IM "Keygen.exe" /f>NUL 2>&1
    exit
     
    :windows
    cls
    setlocal enabledelayedexpansion
    set spp=SoftwareLicensingProduct
    set sps=SoftwareLicensingService
    for /f "tokens=2 delims==" %%A IN ('"wmic path %sps% get version /format:list"') do set ver=%%A
    if defined ver ( for /f "tokens=2 delims==" %%A in ('"wmic path %spp% where (Description LIKE '%%KMSCLIENT%%') get ID /format:list"') do set wid=%%A
    if defined wid ( set /a win=0
    for /f "tokens=2 delims==" %%A in ('"wmic path %sps% where version='%ver%' get KeyManagementServiceMachine /format:list"') do if not %%A==localhost wmic path %sps% where version='%ver%' call SetKeyManagementServiceMachine MachineName="localhost">NUL 2>&1
    for /f "tokens=2 delims==" %%A in ('"wmic path %spp% where (Description LIKE '%%KMSCLIENT%%') get LicenseStatus /format:list"') do set /a wpk=%%A
    if not !wpk! EQU 1 ( call :insKey !wid!
    wmic path %sps% where version='%ver%' call RefreshLicenseStatus>NUL 2>&1
    )
    call :activate !wid!
    )
    )
    If not defined win ( set msg=No supported Windows OS detected...
    cls
    echo !msg!
    call :speak "!msg!"
    )
    endlocal
    exit /b
     
    :office
    cls
    setlocal enabledelayedexpansion
    set spp=OfficeSoftwareProtectionProduct
    set sps=OfficeSoftwareProtectionService
    for /f "tokens=2 delims==" %%A IN ('"wmic path %sps% get version /format:list"') do set ver=%%A
    if defined ver ( for /f "tokens=2 delims==" %%A in ('"wmic path %sps% where version='%ver%' get KeyManagementServiceMachine /format:list"') do if not %%A==localhost wmic path %sps% where version='%ver%' call SetKeyManagementServiceMachine MachineName="localhost">NUL 2>&1
    set vis="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Office14.VISIO"
    reg query !vis!>NUL 2>&1
    if !ERRORLEVEL! EQU 1 ( set vis="HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Office14.VISIO"
    reg query !vis!>NUL 2>&1
    )
    IF !ERRORLEVEL! EQU 0 for /f "tokens=3" %%A in ('"reg query !vis!| findstr /i "SPPSkuid""') do call :visio %%A
    for /f "tokens=2 delims==" %%A in ('"wmic path %spp% where (Description LIKE '%%KMSCLIENT%%') get ID /format:list"') do call :chkey %%A
    ) else ( set msg=No supported Office product detected...
    cls
    echo !msg!
    call :speak "!msg!"
    )
    endlocal
    exit /b
     
    :chkey
    setlocal enabledelayedexpansion
    wmic path %spp% where ID='%1' get Name|Findstr "Visio">NUL
    if %ERRORLEVEL% EQU 1 ( for /f "tokens=2 delims==" %%A in ('"wmic path %spp% where ID='%1' get LicenseStatus /format:list"') do ( set /a ls=%%A
    if not !ls! EQU 1 call :insKey %1
    call :activate %1
    )
    )
    endlocal
    exit /b
     
    :visio
    setlocal enabledelayedexpansion
    set file="%~dp0key.vbs"
    echo WScript.Echo (LCase("%1"))>%file%
    for /f %%A in ('cscript /nologo %file%') do set id=%%A
    del "%~dp0key.vbs"
    call set id=%id:\0=%
    for /f "tokens=2 delims==" %%A in ('"wmic path %spp% where ID='%id%' get LicenseStatus /format:list"') do ( set /a ls=%%A
    if not !ls! EQU 1 call :insKey %id%
    call :activate %id%
    )
    endlocal
    exit /b
     
    :activate
    cls
    echo.
    for /f "tokens=2 delims==" %%x in ('"wmic path %spp% where ID='%1' get Name /format:list"') do echo Attempting to activate %%x
    set /p var=No. of Activation Attempts:  <NUL
    set /a retry=0
    :act
    wmic path %spp% where ID='%1' call Activate>NUL 2>&1
    set /a retry=%retry%+1
    set /p var=%retry%<NUL
    for /f "tokens=2 delims==" %%x in ('"wmic path %spp% where ID='%1' get GracePeriodRemaining /format:list"') do set gpr=%%x
    if %gpr% LSS 259200 if %retry% LSS 10 goto act
    set /a gpr=%gpr%/60/24
    echo.
    echo Remaining Period: %gpr% day(s)
    echo.
    if %gpr% EQU 180 ( set msg=Product Activation Successful
    echo !msg!
    call :speak "!msg!"
    ) else ( set msg=Product Activation Failed
    echo !msg!
    call :speak "!msg!"
    )
    exit /b
    
    :speak
    echo CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
    "%~dp0vc.vbs" & del "%~dp0vc.vbs"
    exit /b
    
    
    :insKey
    cls
    echo.
    for /f "tokens=2 delims==" %%A in ('"wmic path %spp% where ID='%1' get Name /format:list"') do echo Installing Key for %%A
    set file="%~dp0key.vbs"
    echo edition = "%1">%file%
    echo Set keys = CreateObject ("Scripting.Dictionary")>>%file%
    echo keys.Add "6f327760-8c5c-417c-9b61-836a98287e0c", "VYBBJ-TRJPB-QFQRF-QFT4D-H3GVB">>%file%
    echo keys.Add "9da2a678-fb6b-4e67-ab84-60dd6a9c819a", "V7QKV-4XVVR-XYV4D-F7DFM-8R6BM">>%file%
    echo keys.Add "ea509e87-07a1-4a45-9edc-eba5a39f36af", "D6QFG-VBYP2-XQHM7-J97RH-VVRCK">>%file%
    echo keys.Add "8ce7e872-188c-4b98-9d90-f8f90b7aad02", "V7Y44-9T38C-R2VJK-666HK-T7DDX">>%file%
    echo keys.Add "cee5d470-6e3b-4fcc-8c2b-d17428568a9f", "H62QG-HXVKF-PP4HP-66KMR-CW9BM">>%file%
    echo keys.Add "8947d0b8-c33b-43e1-8c56-9b674c052832", "QYYW6-QP4CB-MBV6G-HYMCJ-4T3J4">>%file%
    echo keys.Add "ca6b6639-4ad6-40ae-a575-14dee07f6430", "K96W8-67RPQ-62T9Y-J8FQJ-BT37T">>%file%
    echo keys.Add "ab586f5c-5256-4632-962f-fefd8b49e6f4", "Q4Y4M-RHWJM-PY37F-MTKWH-D3XHX">>%file%
    echo keys.Add "ecb7c192-73ab-4ded-acf4-2399b095d0cc", "7YDC2-CWM8M-RRTJC-8MDVC-X3DWQ">>%file%
    echo keys.Add "45593b1d-dfb1-4e91-bbfb-2d5d0ce2227a", "RC8FX-88JRY-3PF7C-X8P67-P4VTT">>%file%
    echo keys.Add "df133ff7-bf14-4f95-afe3-7b48e7e331ef", "YGX6F-PGV49-PGW3J-9BTGG-VHKC6">>%file%
    echo keys.Add "5dc7bf61-5ec9-4996-9ccb-df806a2d0efe", "4HP3K-88W3F-W2K3D-6677X-F9PGB">>%file%
    echo keys.Add "b50c4f75-599b-43e8-8dcd-1081a7967241", "BFK7F-9MYHM-V68C7-DRQ66-83YTP">>%file%
    echo keys.Add "2d0882e7-a4e7-423b-8ccc-70d91e0158b1", "HVHB3-C6FV7-KQX9W-YQG79-CRY7T">>%file%
    echo keys.Add "92236105-bb67-494f-94c7-7f7a607929bd", "D9DWC-HPYVV-JGF4P-BTWQB-WX8BJ">>%file%
    echo keys.Add "e558389c-83c3-4b29-adfe-5e4d7f46c358", "7MCW8-VRQVK-G677T-PDJCM-Q8TCP">>%file%
    echo keys.Add "9ed833ff-4f92-4f36-b370-8683a4f13275", "767HD-QGMWX-8QTDB-9G3R2-KHFGJ">>%file%
    echo keys.Add "09ed9640-f020-400a-acd8-d7d867dfd9c2", "YBJTT-JG6MD-V9Q7P-DBKXJ-38W9R">>%file%
    echo keys.Add "ef3d4e49-a53d-4d81-a2b1-2ca6c2556b2c", "7TC2V-WXF6P-TD7RT-BQRXR-B8K32">>%file%
    echo keys.Add "ae2ee509-1b34-41c0-acb7-6d4650168915", "33PXH-7Y6KF-2VJC9-XBBR8-HVTHH">>%file%
    echo keys.Add "46bbed08-9c7b-48fc-a614-95250573f4ea", "C29WB-22CC8-VJ326-GHFJW-H9DH4">>%file%
    echo keys.Add "1cb6d605-11b3-4e14-bb30-da91c8e3983a", "YDRBP-3D83W-TY26F-D46B2-XCKRJ">>%file%
    echo keys.Add "b92e9980-b9d5-4821-9c94-140f632f6312", "FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4">>%file%
    echo keys.Add "5a041529-fef8-4d07-b06f-b59b573b32d2", "W82YF-2Q76Y-63HXB-FGJG9-GF7QX">>%file%
    echo keys.Add "54a09a0d-d57b-4c10-8b69-a842d6590ad5", "MRPKT-YTG23-K7D7T-X2JMM-QY7MG">>%file%
    echo keys.Add "7482e61b-c589-4b7f-8ecc-46d455ac3b87", "74YFP-3QFB3-KQT8W-PMXWJ-7M648">>%file%
    echo keys.Add "620e2b3d-09e7-42fd-802a-17a13652fe7a", "489J6-VHDMP-X63PK-3K798-CPX3Y">>%file%
    echo keys.Add "8a26851c-1c7e-48d3-a687-fbca9b9ac16b", "GT63C-RJFQ3-4GMB6-BRFB9-CB83V">>%file%
    echo keys.Add "f772515c-0e87-48d5-a676-e6962c3e1195", "736RG-XDKJK-V34PF-BHK87-J6X3K">>%file%
    echo keys.Add "cda18cf3-c196-46ad-b289-60c072869994", "TT8MH-CG224-D3D7Q-498W2-9QCTX">>%file%
    echo keys.Add "68531fb9-5511-4989-97be-d11a0f55633f", "YC6KT-GKW9T-YTKYR-T4X34-R7VHC">>%file%
    echo keys.Add "a78b8bd9-8017-4df5-b86a-09f756affa7c", "6TPJF-RBVHG-WBW2R-86QPH-6RTM4">>%file%
    echo keys.Add "4f3d1606-3fea-4c01-be3c-8d671c401e3b", "YFKBB-PQJJV-G996G-VWGXY-2V3X8">>%file%
    echo keys.Add "2c682dc2-8b68-4f63-a165-ae291d4cf138", "HMBQG-8H2RH-C77VX-27R82-VMQBT">>%file%
    echo keys.Add "cfd8ff08-c0d7-452b-9f60-ef5c70c32094", "VKK3X-68KWM-X2YGT-QR4M6-4BWMV">>%file%
    echo keys.Add "d4f54950-26f2-4fb4-ba21-ffab16afcade", "VTC42-BM838-43QHV-84HX6-XJXKV">>%file%
    echo keys.Add "7afb1156-2c1d-40fc-b260-aab7442b62fe", "RCTX3-KWVHP-BR6TB-RB6DM-6X7HP">>%file%
    echo keys.Add "68b6e220-cf09-466b-92d3-45cd964b9509", "7M67G-PC374-GR742-YH8V4-TCBY3">>%file%
    echo keys.Add "fd09ef77-5647-4eff-809c-af2b64659a45", "22XQ2-VRXRG-P8D42-K34TD-G3QQC">>%file%
    echo keys.Add "c1af4d90-d1bc-44ca-85d4-003ba33db3b9", "YQGMW-MPWTJ-34KDK-48M3W-X4Q6V">>%file%
    echo keys.Add "8198490a-add0-47b2-b3ba-316b12d647b4", "39BXF-X8Q23-P2WWT-38T2F-G3FPG">>%file%
    echo keys.Add "01ef176b-3e0d-422a-b4f8-4ea880035e8f", "4DWFP-JF3DJ-B7DTH-78FJB-PDRHK">>%file%
    echo keys.Add "ad2542d4-9154-4c6d-8a44-30f11ee96989", "TM24T-X9RMF-VWXK6-X8JC9-BFGM2">>%file%
    echo keys.Add "2401e3d0-c50a-4b58-87b2-7e794b7d2607", "W7VD6-7JFBR-RX26B-YKQ3Y-6FFFJ">>%file%
    echo keys.Add "ddfa9f7c-f09e-40b9-8c1a-be877a9a7f4b", "WYR28-R7TFJ-3X2YQ-YCY4H-M249D">>%file%
    echo if keys.Exists(edition) then>>%file%
    echo WScript.Echo keys.Item(edition)>>%file%
    echo End If>>%file%
    for /f %%A in ('cscript /nologo %file%') do set key=%%A
    del %file%
    wmic path %sps% where version='%ver%' call InstallProductKey ProductKey="%key%">NUL 2>&1
    exit /b
    Also for fun this could be applied to other projects so user if they speak english here msgs if installed correctly or not

    Just for fun

    Then I could post a link in first post for those who want to learn how to do it
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,065
    270
    #2 timesurfer, Jan 24, 2011
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Ok I think I did it :eek: IORRT 2.2 with hidden files and voice confirmation :p

    IORRT 2.2

    Code:
    @echo off
    @color 0C
    title IORRT 2.2
    
    REM Variables
    set InstallRoot=
    set OfficeArchType=
    
    REM Check Office Architecture Type
    if '%processor_architecture%'=='x86' Set OfficeArchType=32 && Goto:EndArchCheck
    goto:WOWCheck
    
    :WOWCheck
    2>nul REG QUERY HKLM\SOFTWARE\Microsoft\Office\14.0\Common | find /i "InstallRoot" 1>nul
    IF ERRORLEVEL 1 Set OfficeArchType=WOW && Goto:EndArchCheck
    Set OfficeArchType=64
    
    :EndArchCheck
    
    REM Get Office Installed Path
    if %OfficeArchType%==WOW (
    FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Common\InstallRoot" /v Path') DO SET InstallRoot=%%B 
    Goto:FoundPath
    )
    FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Common\InstallRoot" /v Path') DO SET InstallRoot=%%B
    
    :FoundPath
    
    REM Start OSPPSVC (To make sure it is started to prevent strange cases where it doesn't start automatically from failing (XP))
    1>nul 2>nul net start osppsvc
    
    :MAINMENU
    mode con: cols=45 lines=10
    CLS
    echo.
    echo.
    echo.  
    echo.    InfiniteOfficeRestoreRearmTask (IORRT) 
    echo.    
    echo.               A. Install
    echo.               B. Uninstall
    echo.               C. Restore/Rearm
    echo.               D. Status
    echo.               E. Exit
    echo.
      
    :CHOOSEACTION
    set /p userinp=    ^   Make your selection: 
    set userinp=%userinp:~0,1%
    if /i "%userinp%"=="A" goto Install
    if /i "%userinp%"=="B" goto Uninstall
    if /i "%userinp%"=="C" goto Restore/Rearm
    if /i "%userinp%"=="D" goto Status
    if /i "%userinp%"=="E" goto Exit
    echo.Try Again...
    GOTO CHOOSEACTION
    
    :Install
    CLS
    mode con: cols=64 lines=21
    title IORRT 2.2
    schtasks /query | FINDSTR /I "IORRT" >NUL 
    IF ERRORLEVEL 1 (
    echo Checking rearm status...
    echo.
    ) ELSE (
    echo IORRT has already been installed...
    echo.
    echo Press any key to return to the main menu
    PAUSE 1>nul
    GOTO MAINMENU
    )
    mkdir "%SystemDrive%\Check"
    net stop osppsvc
    xcopy /cheriky "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" "%SystemDrive%\Check\Backup\Files\Tokens"
    mkdir "%SystemDrive%\Check\Backup\Registry"
    reg save "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\Check\Backup\Registry\OfficeSPPInfo.hiv
    net start osppsvc
    IF Exist "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" ( 
    "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    ) ELSE ( "%commonprogramfiles(x86)%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    )
    if errorlevel==0 goto Pass
    net stop osppsvc
    xcopy /cheriky "%SystemDrive%\Check\Backup\Files\Tokens" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform"
    REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    reg restore "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\Check\Backup\Registry\OfficeSPPInfo.hiv
    net start osppsvc
    DEL "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform\Backup.hiv" 2> nul
    SET file=%SystemDrive%\Check
    IF EXIST %file% attrib -h %file%
    RD /S /Q  %file%
    echo.
    echo.No rearms detected...
    set msg=No rearms detected
    call :speak "No rearms detected"
    :speak
    echo CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
    "%~dp0vc.vbs" & del "%~dp0vc.vbs"
    echo.
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    :Pass
    net stop osppsvc
    xcopy /cheriky "%SystemDrive%\Check\Backup\Files\Tokens" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform"
    REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    reg restore "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\Check\Backup\Registry\OfficeSPPInfo.hiv
    net start osppsvc
    DEL "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform\Backup.hiv" 2> nul
    SET file=%SystemDrive%\Check
    IF EXIST %file% attrib -h %file%
    RD /S /Q  %file%
    echo.
    echo Installing IORRT...
    echo.
    mkdir "%SystemDrive%\IORRT"
    net stop osppsvc
    xcopy /cheriky "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" "%SystemDrive%\IORRT\Backup\Files\Tokens"
    mkdir "%SystemDrive%\IORRT\Backup\Registry"
    reg save "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup\Registry\OfficeSPPInfo.hiv
    net start osppsvc
    SET file=%SystemDrive%\IORRT\IORRT.bat
    IF EXIST %file% attrib -h %file% 
    echo @echo off >%file%
    echo net stop osppsvc >>%file%
    echo xcopy /cheriky "%SystemDrive%\IORRT\Backup\Files\Tokens" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" >>%file%
    echo REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >>%file%
    echo REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >>%file%
    echo reg restore "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup\Registry\OfficeSPPInfo.hiv >>%file%
    echo net start osppsvc >>%file%
    echo IF Exist "%COMMONPROGRAMFILES%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" ( >>%file%
    echo "%COMMONPROGRAMFILES%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" >>%file%
    echo ) ELSE ( "%COMMONPROGRAMFILES(X86)%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" >>%file%
    echo ) >>%file%
    echo schtasks /delete /tn "IORRT" /f >>%file%
    echo schtasks /create /tn "IORRT" /tr "%SystemDrive%\IORRT\IORRT.bat" /sc daily /mo 1 /ru "" >>%file%
    IF Exist "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" ( 
    "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    ) ELSE ( "%commonprogramfiles(x86)%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    )
    attrib +h "%SystemDrive%\IORRT"
    schtasks /create /tn "Hybrid" /tr "%SystemDrive%\IORRT\IORRT.bat" /sc onstart /ru ""
    schtasks /create /tn "IORRT" /tr "%SystemDrive%\IORRT\IORRT.bat" /sc daily /mo 1 /ru ""
    echo.
    cd /d "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    schtasks /query | FINDSTR /I "IORRT"
    set msg=Installation Successful
    call :speak "Installation Successful"
    :speak
    echo CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
    "%~dp0vc.vbs" & del "%~dp0vc.vbs"
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Uninstall
    mode con: cols=64 lines=21
    title IORRT 2.2
    schtasks /query | FINDSTR /I "IORRT" >NUL
    IF '%ERRORLEVEL%' EQU '0' (
    echo Uninstalling IORRT...
    echo.
    ) ELSE (
    echo IORRT is already uninstalled...
    echo.
    echo Press any key to return to the main menu
    PAUSE 1>nul
    GOTO MAINMENU
    )
    net stop osppsvc
    xcopy /cheriky "%SystemDrive%\IORRT\Backup\Files\Tokens" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform"
    REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    reg restore "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup\Registry\OfficeSPPInfo.hiv
    net start osppsvc
    DEL "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform\Backup.hiv" 2> nul
    SET file=%SystemDrive%\IORRT
    IF EXIST %file% attrib -h %file%
    RD /S /Q  %file%
    schtasks /delete /tn "Hybrid" /f
    schtasks /delete /tn "IORRT" /f
    cd /d "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    schtasks /query | FINDSTR /I "IORRT"
    set msg=Uninstall Successful
    call :speak "Uninstall Successful"
    :speak
    echo CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
    "%~dp0vc.vbs" & del "%~dp0vc.vbs"
    echo.
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Restore/Rearm
    mode con: cols=64 lines=21
    title IORRT 2.2
    schtasks /query | FINDSTR /I "IORRT" >NUL 
    IF '%ERRORLEVEL%' EQU '0' (
    echo Restoring/Rearming...
    echo.
    ) ELSE (
    echo Install IORRT before you Restore/Rearm...
    echo.
    echo Press any key to return to the main menu
    PAUSE 1>nul
    GOTO MAINMENU
    )
    net stop osppsvc
    xcopy /cheriky "%SystemDrive%\IORRT\Backup\Files\Tokens" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform"
    REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    reg restore "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup\Registry\OfficeSPPInfo.hiv
    net start osppsvc
    IF Exist "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" ( 
    "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    ) ELSE ( "%commonprogramfiles(x86)%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    )
    schtasks /delete /tn "IORRT" /f 
    schtasks /create /tn "IORRT" /tr '"%SystemDrive%\IORRT\IORRT.bat"' /sc daily /mo 1 /ru ""
    cd /d "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    schtasks /query | FINDSTR /I "IORRT"
    set msg=Restore and Rearm Successful
    call :speak "Restore and Rearm Successful"
    :speak
    echo CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
    "%~dp0vc.vbs" & del "%~dp0vc.vbs"
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Status
    mode con: cols=64 lines=21
    title IORRT 2.2
    cd /D "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    schtasks /query | FINDSTR /I "IORRT"
    IF ERRORLEVEL 1 echo IORRT is not yet Installed
    echo.
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Exit
    exit
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Alphawaves

    Alphawaves Super Moderator/Developer
    Staff Member

    Aug 11, 2008
    5,864
    20,049
    180
    Cool ts, would be cool to have the HAL voice...lol:cool:
    Nice one..
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,065
    270
    Credits go to MasterDisaster
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,065
    270
    #5 timesurfer, Jan 24, 2011
    Last edited: Jan 24, 2011
    (OP)
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,065
    270
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,065
    270
    Anyone know how to pause for like 5 seconds after last cmd then exit? In .bat or .vbs

    Thank you
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. searchengine

    searchengine Guest

    #8 searchengine, Jan 26, 2011
    Last edited by a moderator: Apr 20, 2017
    Example .bat

    Code:
    @echo off
    
    ping -n 6 127.0.0.1 >nul
    
    exit
    eg. 6 = 5 second delay
    eg. 11 = 10 second delay
    eg. 28 = 27 second delay

    etc.
     
  9. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,065
    270
    #9 timesurfer, Jan 26, 2011
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Thanks searchengine I found that code too but I thought it had to do with network...lol

    I have streamlined IORRT 2.7 RC so I wanted it to close after 5-10 seconds so I don't need close option

    Thank you
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. NICK@NUMBER11

    NICK@NUMBER11 MDL Expert

    Mar 23, 2010
    1,354
    631
    60
    strText = ("Listen now")
    Set objvoice = CreateObject ("SAPI.SpVoice")
     
  11. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,065
    270
    #11 timesurfer, Jan 26, 2011
    Last edited: Jan 27, 2011
    (OP)
    Can you explain what are you trying to tell me?

    Here is my latest IORRT 2.8 where I got voice and exit is automatic

    Thank you
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...