Home  /  Resources & support  /  FAQs  /  Installing Stata 19 from the Windows command line

How can I install StataNow 19 or Stata 19 from the command line without GUI under Windows?

Title   Installing StataNow 19 or Stata 19 from the Windows command line
Author Hua Peng, StataCorp

This FAQ explains how to install Stata or StataNow from the command line. Below, we will refer to Stata, but we really mean either Stata or StataNow. We will be explicit if you need to do something different for one versus the other.

StataNow 19 and Stata 19 require a minimum Windows OS level of Windows 10. See a list of supported Windows OS.

  • The installer requires the user who performs the installation to have administrator privileges on the system.
  • To install Stata from the command line without GUI, launch the Windows Command Prompt as Administrator.
  • You may launch the Windows Command Prompt as Administrator by pressing Windows+R to open the “Run” box. Type cmd into the box, and then press Ctrl+Shift+Enter to run the command as an administrator.
  • To run SetupStata19.exe, use the /s option. You also need to use /v"/qn" to pass /qn to suppress the enclosed MSI script's GUI. If you are installing StataNow, use SetupStataNow19.exe instead.
  • To add features, use ADDLOCAL. There is one required feature:
    core Required Stata files and dlls
    The following features need to be installed based on your license:
    StataMP6464-bit Stata/MP or StataNow/MP
    StataSE6464-bit Stata/SE or StataNow/SE
    StataBE6464-bit Stata/BE or StataNow/BE
  • The following properties can be used to control the behavior of the installation:
    USEPERSONALDIRDefault to 1
    INSTALLDIR1Default to “C:\data”
    ALLUSERSDefault to 1
    USERNAMEDefault to current user
  • To pass the properties to the enclosed MSI script, use syntax /v"PROPERTY=value"
  • Examples (drive E: is arbitrary and represents the USB drive or the drive that contains the downloaded installer)
    To install 64-bit StataNow/MP for all users:
           E:\SetupStataNow19.exe /s /v"/qn ADDLOCAL=core,StataMP64"
    
    To install 64-bit Stata/BE for all users, and using the "C:\data" folder as the default working directory:
           E:\SetupStata19.exe /s /v"/qn ADDLOCAL=core,StataBE64 USEPERSONALDIR=0"
    
    To perform a silent uninstall of StataNow from command line:
           E:\SetupStataNow19.exe /s /x /v"/qn"
    
  • Important notes:
    • Both /s and /v are lowercase.
    • Features for ADDLOCAL are case sensitive, "core" is correct and "Core" is incorrect.
    • There must be no space between /v and the following double quote.

  • How to extract StataNow19.msi from SetupStataNow19.exe or Stata19.msi from SetupStata19.exe:
  • Method 1

    1. Create the folder stata_install in the C: drive.
    2. Launch cmd.exe as an administrator.
    3. Use cd to move into the folder where SetupStataNow19.exe is located.
    4. Type

    	SetupStataNow19.exe /s /x /b"C:\stata_install" /v"/qn"
    5. StataNow19.msi will be in C:\stata_install\.

    Method 2

    1. Run SetupStataNow19.exe once it is on a Windows machine.
    2. Search for StataNow19.msi; it is usually in a sub-folder of the following location:

       	C:\Users\YOURUSERNAME\AppData\Local\Downloaded Installations\

    How can I install Stata 18 from the command line without GUI under Windows?