so I’m creating a LEGIT Office 2013 activator , it uses our Genuine key and runs /act script to activate it.
So in order to check for a x32 or x64 bit of Office , I made the cmd search for a file called ospp.vbs , if it was found in x86 then it is x32 , if it was found in program files then it is x64. but if it wasn’t found inside x32 it proceeds to the next step , but it tells me /microsoft was not expected , and then it closes?
Here’s my CMD file:
@echo off
echo.Microsoft Office 2013 Activator
pause >nul
cls
NET SESSION >nul 2>&1
IF %ERRORLEVEL% EQU 0 (
goto :Start
) ELSE (
echo.
echo.
echo.
echo. ERROR: YOU ARE NOT AN ADMIN!
ECHO. PLEASE RUN THIS TOOL AS AN ADMIN IN ORDER FOR IT TO WORK PROPERLY
ECHO. PRESS ANY KEY TO EXIT THE TOOL
PAUSE >NUL
EXIT
)
:Start
type "C:\program files (x86)\microsoft office\office15\ospp.vbs" >NUL 2>NUL
if %ERRORLEVEL% EQU 0 (
echo.x32 Office 2013 on x64 Machine Found.
echo.Why did you get x32 Office on an x64 Machine?
echo.Preparing to activate...
pause >nul
cls
goto :x32
) ELSE (
goto :x64check
)
:x64check
type "C:\program files\microsoft office\office15\ospp.vbs" >NUL 2>NUL
if %ERRORLEVEL% EQU 0 (
echo.x64 Office 2013 on x64 Machine Found
echo.or
echo.x32 Office 2013 on x32 Machine Found
echo.Preparing to Activate...
pause >nul
cls
goto :x64
) ELSE (
echo.Office 2013 Could not be found on this machine...
echo.Are you sure Office 2013 is installed?
echo.If it is installed , search for ospp.vbs in C:\program Files (x86)\Microsoft Office\Office 15\
pause >nul
cls
)
:x32
cd "C:\program files (x86)\microsoft office\Office15\"
cls
cscript ospp.vbs /remhst
cls
cscript ospp.vbs /act
cls
cscript ospp.vbs /dstatus
pause >nul
echo Check the Above to see if Activation succeded or press any key to open winword and check it maunally.
pause >nul
start winword
:x64
cd "C:\program files\microsoft office\Office15\"
cls
cscript ospp.vbs /remhst
cls
cscript ospp.vbs /act
cls
cscript ospp.vbs /dstatus
pause >nul
echo Check the Above to see if Activation succeded or press any key to open winword and check it maunally.
pause >nul
start winword
can you please tell me where my problem is?
Thanks!
The reason for that error message is this line:
The close parentheses
)is being interpreted as the end of the scope for theelse. Escape the parentheses when using them as literals and they are not contained within quotations.