Prior to 10.1, I could locate the server.dat file, and programmatically find out the arcgisoutput folder URL location (virtual directory when using IIS)



At 10.1, the arcgisserver folder default location is now: C:\arcgisserver\directories\arcgisoutput

This is fine, but how do I find out what URL was set to in the post install?

I understand that there is now an embedded Tomcat within 10.1 (similar to Java edition of AGS), but I am unsure on which file contains the URL info (including the port number).

Have reopened this Q, as have agreed with FredP that there should be a better approach to get the arcgisserver physical AND virtual paths from ArcObjects.


You can issue a HTTP request through the ArcGIS Server REST Administration API. See Scripting with the ArcGIS Server Administrator API, which is Python-oriented, but covers the ground quite well).

For example, when I issue a request to ; http://arcgisserverhostname/arcgis/admin/system/directories/arcgisoutput?f=pjson, I get

  "name": "arcgisoutput",
  "physicalPath": "C:\\arcgisserver\\directories\\arcgisoutput",
  "directoryType": "OUTPUT",
  "maxFileAge": 10,
  "description": "Stores various information generated by services, such as map images.",
  "virtualPath": "/rest/directories/arcgisoutput"

Prior 10.1, I alsways used the getVirtualOutputDirectory() of the MapServer object: http://resources.esri.com/help/9.3/arcgisengine/java/api/arcobjects/com/esri/arcgis/carto/MapServer.html#getVirtualOutputDirectory()

This methods returned for me (under AGS-Java) the complete output path, like: http://myServer/arcgisoutput

Now in 10.1, I just get "/rest/directories/....". It's a relative path ! :-(

I suppose it's a BUG in the 10.1 version, it should return the full virtual outputpath as under AGS-Java-10.



I write a file called "help.html" here :

C:\Program Files\ArcGIS\Server\framework\runtime\tomcat\webapps\ROOT

I get it here :


Now here is how I would proceed:

  1. identify the install directory, hint : it's in HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\Server10.1 under a string called "InstallDir"

  2. append "framework\runtime\tomcat\webapps\ROOT" to C:\Program Files\ArcGIS\Server\ and you have your PHYSICAL DIRECTORY

  3. Now get the local ip or hostname and make sure the port is correct. HINT : parse through C:\Program Files\ArcGIS\Server\framework\runtime\tomcat\conf\server.xml and you will find the PORT. Be careful, there are a few PORT's mentioned in there, find the one with it MUST be the line with protocol=http/1.1

IMPORTANT NOTE ABOUT FOLDER ACCESS : The folder framework\runtime\tomcat\webapps\ROOT will not be writable by your application. I suggest you add a sub-folder \temp and change the sharing securities to allow all users to write/read.


Actually, we should be able to use IServerDirectory2 .. but when I call this, all the returned values are empty.

IServerDirectory2Ptr pServerDir(CLSID_ServerDirectory);
    if (pServerDir)
        BSTR bstrPath(L"");
        BSTR bstrUrl(L"");
        BSTR sDescr(L"");
        hr = pServerDir->get_Description(&sDescr);
        hr = pServerDir->get_Path(&bstrPath);
        hr = pServerDir->get_URL(&bstrUrl);

Link V9.3.1 | Link ArcGIS10.1

  • 1
    We tried IServerDirectoryPtr=returns empty strings; IServerMachine3Ptr=invalid pointer; IServerObjectAdmin=Unable to create (error=Class not registered) – Simon Jul 4 '12 at 12:34

You also have the method getPhysicalOutputDirectory() of the MapServer object: http://resources.esri.com/help/9.3/arcgisengine/java/api/arcobjects/com/esri/arcgis/carto/MapServer.html#getPhysicalOutputDirectory()

This returns the physical directory of the mapservice.

  • do you know if this exists at 10.1? – Simon Jul 3 '12 at 8:48
This only works for ArcGIS10.1

// 1. get HKLM\software\esri\server10.1\ "installDir"
// 2. you get something like C:\Program Files\ArcGIS\Server\
// 3. add \framework\etc\machine-config.xml
// 4. you open that file and look for <HTTP>6080</HTTP>
// 5. you can also read the <MachineName> tag
// 6. open the file c:\arcgisserver\config-store\serverdirs\arcgisoutput.json
// 7. it's json code : get the physicalPath (ex: C:\\arcgisserver\\directories\\arcgisoutput)
// 7.1 : TEST write some "foo.html" in there
// 8.                : get the maxFileAge
// 9.                : get the cleanUpMode 
// 10.               : get the "virtualpath" (ex: /rest/directories/arcgisoutput)
// 11. use the machine name and port you got in (4) and (5) and add the virtualpath you got in (10)
// 12. You should have a URL like : http://servername:6080/rest/directories/arcgisoutput
// 12.1 : TEST with a browser http://servername:6080/rest/directories/arcgisoutput/foo.html and it should work. 

in my case : 

I write: C:\arcgisserver\directories\arcgisoutput\foo.html
and I get it also from: http://twirl:6080/arcgis/rest/directories/arcgisoutput/foo.html


I just stumbled upon this question, thus this answer late - but you should be using the REST Admin to get this sort of information. You build up URLs, and using a token obtained through the generateToken you supply credentials and then use them to query certain aspects of the server.

See this help link for information regarding the Server Admin API: http://resources.arcgis.com/en/help/server-admin-api/

The directory information (from the original question) is available at: http://:6080/arcgis/admin/system/directories

If you want Python code that demonstrates how to get a token and some queries (not this one specifically, but again, just build up the URL), check here: http://www.arcgis.com/home/item.html?id=12dde73e0e784e47818162b4d41ee340

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.