<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error running Batch Watershed Delineation - trying to write to system folder in Water Resources Questions</title>
    <link>https://community.esri.com/t5/water-resources-questions/error-running-batch-watershed-delineation-trying/m-p/1043348#M4018</link>
    <description>&lt;P&gt;you can write similar code to randomize path for every task generate intermediate raster&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;static Random random = new Random();
internal static char GetLetter()
{
            // This method returns a random lowercase letter.
            // ... Between 'a' and 'z' inclusize.
            int num = random.Next(0, 26); // Zero to 25
            char let = (char)('a' + num);
            return let;
}


IHydrologyOp2 hydrologyOp = new RasterHydrologyOpClass();
IRasterAnalysisEnvironment rasterAnalysisEnvironment = hydrologyOp as IRasterAnalysisEnvironment;
rasterAnalysisEnvironment.DefaultOutputRasterPrefix = Helper.GetLetter() + (Guid.NewGuid().ToString("N")).Substring(0, 3);


&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so you have :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;C:\Users\&lt;EM&gt;user&lt;/EM&gt;\AppData\Local\Temp\1\XXXX5694\&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (XXXX&amp;nbsp; string random)&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Apr 2021 13:48:35 GMT</pubDate>
    <dc:creator>nicogis</dc:creator>
    <dc:date>2021-04-02T13:48:35Z</dc:date>
    <item>
      <title>Error running Batch Watershed Delineation - trying to write to system folder</title>
      <link>https://community.esri.com/t5/water-resources-questions/error-running-batch-watershed-delineation-trying/m-p/245157#M1100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am getting an error running Batch Watershed Delineation (ArcMap 10.2.2, ArcHydro 10.2.0.85):&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;WshDelineationFromPointAndAdjointCatchment:System.Runtime.InteropServices.COMException (0x80041098): ERROR 010429: Error in GRID IO: CellLyrCreateInternal: &lt;STRONG&gt;Unable to create cell layer directory c:\windows\system32\ras0421&amp;nbsp; .&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ERROR 010067: Error in executing grid expression.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.SpatialAnalyst.RasterHydrologyOpClass.Watershed(IGeoDataset directionRaster, IGeoDataset sourceDataset)&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note the software is trying to write to C:\Windows\system32 (a system folder). Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;Deleting the ArcHydro temp folder in TEMP: &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;C:\Users\&lt;EM&gt;user&lt;/EM&gt;\AppData\Local\Temp\1\arc5694\&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and restarting ArcMap solved the problem. I'm assuming the tool was having trouble writing there and then failing over to the system folder, although my C drive had plenty of space.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 20:55:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/water-resources-questions/error-running-batch-watershed-delineation-trying/m-p/245157#M1100</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2015-01-21T20:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Error running Batch Watershed Delineation - trying to write to system folder</title>
      <link>https://community.esri.com/t5/water-resources-questions/error-running-batch-watershed-delineation-trying/m-p/1043348#M4018</link>
      <description>&lt;P&gt;you can write similar code to randomize path for every task generate intermediate raster&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;static Random random = new Random();
internal static char GetLetter()
{
            // This method returns a random lowercase letter.
            // ... Between 'a' and 'z' inclusize.
            int num = random.Next(0, 26); // Zero to 25
            char let = (char)('a' + num);
            return let;
}


IHydrologyOp2 hydrologyOp = new RasterHydrologyOpClass();
IRasterAnalysisEnvironment rasterAnalysisEnvironment = hydrologyOp as IRasterAnalysisEnvironment;
rasterAnalysisEnvironment.DefaultOutputRasterPrefix = Helper.GetLetter() + (Guid.NewGuid().ToString("N")).Substring(0, 3);


&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so you have :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;C:\Users\&lt;EM&gt;user&lt;/EM&gt;\AppData\Local\Temp\1\XXXX5694\&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (XXXX&amp;nbsp; string random)&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 13:48:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/water-resources-questions/error-running-batch-watershed-delineation-trying/m-p/1043348#M4018</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2021-04-02T13:48:35Z</dc:date>
    </item>
  </channel>
</rss>

