Error In Executing Cmd.exe /c
Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Geographic Information Systems Questions Tags Users Badges Unanswered Ask Question _ Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Arcpy unzipping script: ERROR 000714 Error in executing: cmd.exe /C up vote 0 down vote favorite I wrote script for unzip archive with GDB. It works locally, i.e from ArcGis Desktop. But when I publish scrypt as geoprocessing service, it doesn't work - ERROR 000714: Error in script Zip22. Error in executing: cmd.exe /C Script: import arcpy import os import sys import traceback import zipfile import re class LicenseError(Exception): pass def unzip(zipFileName): try: path = os.path.dirname(zipFileName) zip = zipfile.ZipFile(zipFileName, 'r') gdb_name = None for name in zip.namelist(): if '.gdb' in name.lower(): gdb_name = name.replace('/', os.sep) break if not gdb_name: raise Exception('zip file has no gdb') zip.extractall(path) zip.close() return path + os.sep + gdb_name except RuntimeError: zip.close() arcpy.AddWarning(get_ID_message(86133)) def get_ID_message(ID): return re.sub("%1|%2", "%s", arcpy.GetIDMessage(ID)) if __name__ == '__main__': try: zipFile = arcpy.GetParameterAsText(0) gdb_name = unzip(zipFile) arcpy.SetParameterAsText(1, gdb_name) except: tb = sys.exc_info()[2] tbinfo = traceback.format_tb(tb)[0] pymsg = "ERRORS:\nTraceback Info:\n" + tbinfo + "\nError Info:\n " + str(sys.exc_type) + ": " + str(sys.exc_value) + "\n" arcpy.AddError(pymsg) Similar script with archiving GDB to zip works fine both locally and at server. What's wrong in this script? arcpy arcgis-10.1 geoprocessing-service share|improve this question edited Aug 30 '15 at 3:00 PolyGeo♦ 39.1k1357143 asked Aug 29 '15 at 11:10 General Failure 178112 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote accepted Problem was not in script text, but in script object in ArcMap. When I checked Run Python script in process and publish this script, it began to work at server too. share|improve this answer edited Aug 31 '15 at 11:24 answered Aug 31 '15 at 10:18 General Failure 178112 add a comment|
In ArcGIS 9.3, when "Run Python script in process" is not checked, the Python script tool fails when it invokes gp.Describe on a layer created in ArcCatalog or ArcMap Reported by: jjr8 Owned by: jjr8 Priority: Medium Milestone: Component: ArcGIS Version: Keywords: Cc: Description ArcGIS bug number assigned by ESRI: Not yet filed with ESRI Affected ArcGIS versions: 9.3 MGET tools impacted by this ArcGIS bug: All tools in the Statistics toolset Detailed description: ArcGIS 9.3 includes the ability to run Python script tools directly in ArcGIS processes such as ArcCatalog.exe and A!rcMap.exe. You enable this by checking the "Run Python script in process" box when adding the tool to a toolbox. When this is enabled, the ArcGIS process hosts http://gis.stackexchange.com/questions/160132/arcpy-unzipping-script-error-000714-error-in-executing-cmd-exe-c the Python interpreter itself, instead of creating a separate CMD.exe and python.exe processes to run the interpreter. But under certain circumstances (as described in the ArcGIS documentation) you cannot check this box. When a tool runs without this box checked, it cannot call gp.Describe on a layer that was created in ArcCatalog or ArcMap and then passed into the tool. gp.Describe fails with error 000714 and the message "A locator with this name https://code.env.duke.edu/projects/mget/ticket/304 does not exist". To reproduce this problem: Start ArcCatalog. Run the Make Feature Layer tool to create a layer for some feature class or shapefile that you have. Create a toolbox and add the Python script below as a tool. Make sure you ENABLE the "Run Python script in process" option. Add a input single parameter to the tool, of type Feature Layer. Run the tool, passing in the layer you just created (select the layer using the drop-down box when you run the tool). The tool will run successfully. Now right click Properties on the tool, DISABLE the "Run Python script in process" option, and click Ok. Rerun the tool, passing in the layer again. The tool will report "gp.Describe failed!" and the exception that was raised by Describe. The problem will also occur if you create a model in ModelBuilder that links the output of the Make Feature Layer tool to the Python tool. Basically, Describe appears to only be looking in the current process for layers, or something like that. It is not written to call back to the parent process to look for layers. Here is the script I referred to in step 3 above. import arcgisscripting gp = arcgisscripting.create() objectName = gp.GetParameterAsText(0) gp.AddMessage('Calling gp.Exists(\'' + objectName + '\')') try: objectExists = gp.Exists(objectNa
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more http://stackoverflow.com/questions/4031390/executing-cmd-exe-commands-from-java about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack http://digital.ni.com/public.nsf/allkb/BAB08D0C947D8DCF862566B200625179 Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Executing cmd.exe commands from Java up vote 12 down vote favorite error in 3 I'm trying to read a file from the user, in which each line is a cmd.exe command, and run it (it's okay to assume the commands are legal), but when I give a command like echo hi, I get runtime exception error: Exception in thread "main" java.io.IOException: Cannot run program "echo": CreateProcess error=2, The system cannot find the file specified I'm trying to run the commands like this: error in executing Runtime.getRuntime().exec(command); where command = "echo hi". This does work for commands like regedit though, so it seems the runtime I'm getting is like the "run" window and not cmd. Is there a way to run these commands? java windows cmd share|improve this question edited Dec 9 '15 at 0:51 paxdiablo 489k1179701419 asked Oct 27 '10 at 8:50 Amir Rachum 22.9k46119212 add a comment| 1 Answer 1 active oldest votes up vote 19 down vote accepted That's because echo is not an external executable command (i.e., there is no echo.exe file on your hard disk, unless you put it there yourself). It's an internal command of the shell. You'll probably find that you need to execute something like: cmd.exe /c echo hello share|improve this answer answered Oct 27 '10 at 8:53 paxdiablo 489k1179701419 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged java windows cmd or ask yo
Development Systems>>Full Development System Primary Software Version: 8.0 Primary Software Fixed Version: N/A Secondary Software: N/A Problem: When I'm compiling a Code Interface Node (CIN), Microsoft Visual C++ reports Error executing c:\winnt\system32\cmd.exe or Error executing c:\windows\system32\cmd.exe
Solution: You need to place double quotes around the strings in the custom build steps setup window. The problem will only occur, if the tools or the dynamic link library (DLL) are in directories that have spaces somewhere in the name. Please reference the Microsoft Knowledge Base article 191495 for more information. Note: KnowledgeBase was previously published under article Q191495. If you've created an empty (common) workspace, you'll need to update the command in the custom build pane from: