Sunday 17 May 2015

Kicking someone off a shapefile in ArcMap



I have ArcMap open, and someone else has the same shapefile open as me. How can I kick them off so that I can edit? I get the following error message: "Unable to save edits, cannot acquire a lock"



Answer



This used to work, but I haven't done this in years. And this is only going to work for a windows machine where you have admin priv:


Remote into the file server and use openfiles.exe /disconnect to disconnect the user from the files.


Or you could use psexec \\machinename cmd and run the openfiles.exe on the remote console.


This question really gets into the realm of file systems, so there could be multiple answers to this question. If the file server is linux, then that will be a different answer (at the time I posted this answer, no OS was mentioned.).


Disclaimer: I'm in no way advocating multi-user editing with shapefiles!


OPENFILES /Disconnect [/S system [/U username [/P [password]]]]
{[/ID id] [/A accessedby] [/O openmode]}
[/OP openfile]


Description:
Enables an administrator to disconnect files and folders that
have been opened remotely through a shared folder.

Parameter List:
/S system Specifies the remote system to connect to.

/U [domain\]user Specifies the user context under which the
command should execute.


/P [password] Specifies the password for the given user
context.

/ID id Specifies to disconnect open files by file ID.
The "*" wildcard may be used.

/A accessedby Specifies to disconnect all open files by
"accessedby" value. The "*" wildcard
may be used.


/O openmode Specifies to disconnect all open files by
"openmode" value. Valid values are Read,
Write or Read/Write. The "*" wildcard
may be used.

/OP openfile Specifies to disconnect all open file
connections created by a specific "open
file" name. The "*" wildcard may be used.


/? Displays this help message.

Examples:
OPENFILES /Disconnect /?
OPENFILES /Disconnect /ID 1
OPENFILES /Disconnect /A username
OPENFILES /Disconnect /O Read/Write
OPENFILES /Disconnect /OP "c:\My Documents\somedoc.doc" /ID 234
OPENFILES /Disconnect /S system /U username /ID 5
OPENFILES /Disconnect /S system /U username /P password /ID *

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...