Stronghold
HomeServicesDocumentationBlog
  • Highly Secure Computing (Stronghold)
  • Data Management
    • SFTP Data Transfers
      • Data Imports
      • Data Exports
    • HTTPS Direct Downloads
      • FastX 3
      • FastX 2
    • Data Storage
    • Globus Transfers
      • Windows Tenants
      • Adding New Users
  • Usage
    • New Tenant Onboarding
    • Windows Environments
      • Access from Mac
      • Access from Windows
      • RDP Gateway from Mac
      • RDP Gateway from Windows
    • Linux Environments
      • FastX 3
      • FastX 2
  • Software
    • Windows Standard Software
    • Linux Standard Software
      • Julia
    • Package Archive Mirrors
      • BioConductor Mirror
      • CRAN Mirror
      • PyPI Mirror
    • Install R/Python Packages from Local File
    • Jupyter Lab on Linux Workstations
    • Changing the temporary folder for softwares
      • SAS
      • STATA
      • RStudio
    • Changing Default Package install locations on Windows
      • Python (Pypi packages)
      • R (CRAN Packages)
      • Stata packages
  • Git
    • Git Sync
    • GitLab
  • Access & Security Groups
    • User Groups
    • Lifespan Staff Access
  • Multi-Protocol Access
    • Access Same Data from Windows and Linux Workstations
Powered by GitBook
On this page
  • 1. Identify a folder outside C:\
  • 2. Change the temporary directory
  • 2.1 Change Windows Environment Variable
  • 2.2 Create myStata.bat

Was this helpful?

  1. Software
  2. Changing the temporary folder for softwares

STATA

PreviousSASNextRStudio

Last updated 7 months ago

Was this helpful?

STATA saves all temporary files in the C:/ in Windows workstations. Since storage quota are limited on the C:/, you should follow these steps to change the temporary directory

1. Identify a folder outside C:\

Find a folder where you are allowed to create and modify files. This is going to be the new SAS temporary folder. In this tutorial, let's assume that the directory is "E:\StataTemp\ccvdemo2"

2. Change the temporary directory

Users can change the temporary directory in different ways. The second way is required for multiple users to run Stata as it allows each user to have their own temporary directory for Stata.

2.1 Change Windows Environment Variable

Users only need to make the following changes ONCE.

Step 1: Launch "Control Panel"

Step 2: Click "System and Security" in Control Panel

Step 3: Click "System"

Step 4: Click "Advanced system settings"

Step 5: Click "Environment Variables"

Step 6: Click "New"

Step 7: Enter the variable name STATATMP and value that is your temp folder, i.e., E:\StataTemp\ccvdemo2.Then click "OK"

After the changes above, whenever Statais launched, it saves temporary files in the configured temporary folder.

2.2 Create myStata.bat

  1. Launch Notepad. (You can click the search icon in the bottom left of the screen on the Taskbar. Type Notepad and click the first icon)

  2. Enter the following text. It contains 4 lines, including a blank line at the bottom:

:top
set dir=E:\statatmp\%random%
if exist %dir% goto top
mkdir %dir%
set statatmp=%dir%
"C:\Program Files\Stata16\StataSE-64.exe"
rmdir /s /q %dir%
goto :eof
  1. On Notepad, click on File -> Save As ...

  2. Click on "Desktop" on the left "Quick Access Panel"

  3. Enter "myStata.bat" in the File name field.

  4. In the "Save as Type" dropdown list, choose "All Files"

  5. Click Save

After the changes above, whenever users double click "myStata" file on the Desktop, Stata is launched and saves temporary files in the configured temporary folder.