Using Stata with Box on wts.umn.edu

So, it is possible, with a small amount of work, to get Stata to write it's temporary data back to the user's Box folder (assuming they are using Box drive), thus keeping all of the data in Box while still using the Stata on the remote desktop. I'll go into detail below on how to do that. Let me know if there are questions, or if you want me to talk either you or your students through how to do it directly.

Instructions for connecting to the remote desktop are at z.umn.edu/wtsconnect

The big thing to note at this stage is to allow the user's local drives to be seen by the remote desktop. For Macs, that's hitting the Redirection button and then adding the Box folder with a name; for Windows, click the 'Show options" down arrow, then choose Local Resources tab, click the "More.." button toward the bottom and check the drive that Box is on (typically C). This will let the remote desktop see the 'local' files.

Once connected, users will need to create a new shortcut to Stata that will point it back to the Box folder on their machine. This will take two steps 1) finding their Box folder through the remote desktop, and 2) creating/editing the shortcut file to match that location. First, to locate the Box folder, start by right clicking on start and choosing File Explorer. There, on the far left, navigate to the bottom, under Network to 'tsclient'. Expand that and pick the drive/named location where Box is. (In Windows it would typically be C:\Users\%username%\Box )

 

Image showing File Explorer browsed to tsclient

Once the Box folder is open, right click in the path/address area and choose "Copy address as text".

Image showing File Explorer copying address as text

Next to make the shortcut: Below is sample text for a file that will set the Box path.  On the remote computer, create a new text document (using notepad) and name it "StataBox.txt". This file should be moved to the desktop on the remote computer. Once it is on the desktop, open it up to edit. The second line, which says "set boxpath=..." is where the path from the step above should be pasted. My path is in there now as an example. Save the file and exit. Then rename the file to StataBox.cmd (with the .txt removed) so it can be run by double clicking it. Run Stata from that shortcut and Stata will write the temp files to Box, keeping things secure. You can confirm this is set in Stata with the two commands: 

 

tempfile test
display "`test'"

Which should read \\tsclient\WHEVERVER\Box\ST_123.tmp

 

Sample file:

@echo off
set boxpath=\\tsclient\C\Users\beck0795\Box

IF EXIST "%boxpath%" (
	set STATATMP=%boxpath%
	start C:\"Program Files (x86)"\Stata15\StataSE-64.exe
) ELSE ( 
	msg %username% Check your Box path and try again. 
)
exit