title: This CMD code checks for x32 or x64 , but it does not function?
body: <p>so I'm creating a LEGIT Office 2013 activator , it uses our Genuine key and runs /act script to activate it.</p>
  
  <p>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:</p>
  
  <pre><code>@echo off
  echo.Microsoft Office 2013 Activator
  pause &gt;nul
  cls
  NET SESSION &gt;nul 2&gt;&amp;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 &gt;NUL
  EXIT
  )
  
  :Start
  type "C:\program files (x86)\microsoft office\office15\ospp.vbs" &gt;NUL 2&gt;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 &gt;nul
  cls
  goto :x32
  ) ELSE (
  goto :x64check
  )
  :x64check
  type "C:\program files\microsoft office\office15\ospp.vbs" &gt;NUL 2&gt;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 &gt;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 &gt;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 &gt;nul
  echo Check the Above to see if Activation succeded or press any key to open winword and check it maunally.
  pause &gt;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 &gt;nul
  echo Check the Above to see if Activation succeded or press any key to open winword and check it maunally.
  pause &gt;nul
  start winword
  </code></pre>
  
  <p>can you please tell me where my problem is? 
  Thanks!</p>