I run a Python script to delete and recreate a set of map services. To do this, I place a folder with all the mxds and data in the same directory as the existing folder, with a different name. The script then renames the folder using os.rename, and then uses that data for the new map services.
The problem is, I get an 'Access Denied' error when I run this. The error is thrown when renaming the existing folder to 'folder_old'. If I restart the server, it will usually work, but this obviously is not ideal. The server is an AWS instance, with ArcGIS 10.2. I have full administrative rights on that machine, and I have IDLE set to run as an administrator.
Is there a preferred ArcPy method to rename a data folder that I should be using instead?
Solved! Go to Solution.
Hi Jason,
You can try the Rename tool.
I will try it, I had the impression that was used specifically for ArcGIS datasets -
from docs: Changes the name of a dataset. This includes a wide variety of data types, among them feature dataset, raster, table, and shapefile.
I also wonder why os.rename causes a problem, although I will not wonder so much if something else works..thanks!