<?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: arcpy.CreateFolder_management doesn't work on Windows 7 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-createfolder-management-doesn-t-work-on/m-p/235086#M18224</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you provide a copy of your script?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe it is referencing a directory on the Windows XP machine that is no longer available in Windows 7.&amp;nbsp; If you are using direct connections to SDE in your python script, the path to these connections has a different location on a Windows 7 machine than on a Windows XP machine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Aug 2012 00:13:45 GMT</pubDate>
    <dc:creator>MichaelVolz</dc:creator>
    <dc:date>2012-08-02T00:13:45Z</dc:date>
    <item>
      <title>arcpy.CreateFolder_management doesn't work on Windows 7</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-createfolder-management-doesn-t-work-on/m-p/235085#M18223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi friends,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you help me with this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Script run on Windows 7 results in this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
Traceback (most recent call last):
&amp;nbsp; File "U:\Tools\Toolbox\PCM_Data_Clip\PCM_Data_Clip.py", line 8, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CreateFolder_management("C:/PCM/", property)
&amp;nbsp; File "c:\program files\arcgis\desktop10.1\arcpy\arcpy\management.py", line 14477, in CreateFolder
&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e
ExecuteError: ERROR 999999: Error executing function.
Failed to execute (CreateFolder).


Failed to execute (PCMDataClip).
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Same script run in Windows XP, works fine. Both computers using ArcMap 10.1, script is kept on shared network drive so no differences there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone know what the issue might be?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2012 23:35:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-createfolder-management-doesn-t-work-on/m-p/235085#M18223</guid>
      <dc:creator>GIS1</dc:creator>
      <dc:date>2012-08-01T23:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.CreateFolder_management doesn't work on Windows 7</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-createfolder-management-doesn-t-work-on/m-p/235086#M18224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you provide a copy of your script?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe it is referencing a directory on the Windows XP machine that is no longer available in Windows 7.&amp;nbsp; If you are using direct connections to SDE in your python script, the path to these connections has a different location on a Windows 7 machine than on a Windows XP machine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 00:13:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-createfolder-management-doesn-t-work-on/m-p/235086#M18224</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2012-08-02T00:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.CreateFolder_management doesn't work on Windows 7</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-createfolder-management-doesn-t-work-on/m-p/235087#M18225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Michael,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"C:/PCM/"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;is the only directory reference in the script. Might it have something to do with backslashes being forward slashes?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 02:01:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-createfolder-management-doesn-t-work-on/m-p/235087#M18225</guid>
      <dc:creator>GIS1</dc:creator>
      <dc:date>2012-08-02T02:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.CreateFolder_management doesn't work on Windows 7</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-createfolder-management-doesn-t-work-on/m-p/235088#M18226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import os
os.makedirs(r"c:\NewFolede")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:51:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-createfolder-management-doesn-t-work-on/m-p/235088#M18226</guid>
      <dc:creator>BartłomiejStaroń</dc:creator>
      <dc:date>2021-12-11T11:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.CreateFolder_management doesn't work on Windows 7</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-createfolder-management-doesn-t-work-on/m-p/235089#M18227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try removing the trailing forward slash. It works fine for me using ArcGIS 10.0 either way though. I'm not even sure why this needs to be part of the arcpy package though, as tlomiej1 said os.makedirs or os.mkdir are already available.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 12:36:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-createfolder-management-doesn-t-work-on/m-p/235089#M18227</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-08-02T12:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.CreateFolder_management doesn't work on Windows 7</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-createfolder-management-doesn-t-work-on/m-p/235090#M18228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Still happening randomly to me, now on XP.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ran the same script 3 times for different sets of data each time. First 2 times ran fine, third set it did not like and gave this error....&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2012 21:14:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-createfolder-management-doesn-t-work-on/m-p/235090#M18228</guid>
      <dc:creator>GIS1</dc:creator>
      <dc:date>2012-10-17T21:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.CreateFolder_management doesn't work on Windows 7</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-createfolder-management-doesn-t-work-on/m-p/235091#M18229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I use the following to create a Systems PDF folder every time i run this map export script. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy, os, datetime, sys&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

arcpy.env.overwriteOutput = True

#Setup variables
mxd = arcpy.mapping.MapDocument("CURRENT")
mxdPath = mxd.filePath
dataPath = mxdPath.replace(os.path.basename(mxdPath), "System PDFs\\")


try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; os.makedirs(dataPath)
except OSError:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if os.path.exists(dataPath):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # We are nearly safe
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # There was an error on creation, so make sure we know about it
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:51:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-createfolder-management-doesn-t-work-on/m-p/235091#M18229</guid>
      <dc:creator>AnthonyTimpson2</dc:creator>
      <dc:date>2021-12-11T11:51:39Z</dc:date>
    </item>
  </channel>
</rss>

