shellexecute

Need to execute shell script from webapp and display console output in page

我的未来我决定 提交于 2019-12-31 05:47:05
问题 I am looking for java examples or library that will help me integrate this into a Struts2/Spring application. Many build systems such as Luntbuild or Hudson have this functionality, I thought I would ask if any one knows of a standalone example before I attempted to dig it out of one of those. I glanced at Quartz job scheduling framework also, but I haven't found the UI hooks yet. Do I just need to read from a file with a JSP include? 回答1: If I understand what you are trying to do, this is

Close external application launched from R

馋奶兔 提交于 2019-12-31 05:03:25
问题 Is it possible to close an application that was launched from within R? Assume that I have opened a CSV file my_file.csv with its associated application via the shell.exec function. I then want to close this application. 回答1: Since R has no control over other programs you cannot directly close files opended without R reliably. You do not even know which program to close. E.g. one one computer a csv file may be opened with notepad, on another computer it may be opened with Excel. If you know

Close external application launched from R

南笙酒味 提交于 2019-12-31 05:03:12
问题 Is it possible to close an application that was launched from within R? Assume that I have opened a CSV file my_file.csv with its associated application via the shell.exec function. I then want to close this application. 回答1: Since R has no control over other programs you cannot directly close files opended without R reliably. You do not even know which program to close. E.g. one one computer a csv file may be opened with notepad, on another computer it may be opened with Excel. If you know

Exec vs ExecWait vs ExecShell vs nsExec::Exec vs nsExec::ExecToLog vs nsExec::ExecToStack vs ExecDos vs ExeCmd

人走茶凉 提交于 2019-12-29 10:14:12
问题 Can I know what are the differences between each Exec , ExecWait , ExecShell , nsExec::Exec , nsExec::ExecToLog, nsExec::ExecToStack , ExecDos and ExecCmd , as in when to use which? I 've posted the various execute calls I know. I am trying to make a comprehensive list, so that it helps future visitors.. Exec : Plainly execute the called string, be it some application, console or file. ExecWait : Executes like Exec but waits till the process exits. ExecShell : What is it for? nsExec::Exec :

ShellExecute函数介绍

喜欢而已 提交于 2019-12-26 23:45:00
功能:ShellExecute的功能是运行一个外部程序 头文件:#include <shellapi.h> 函数原型: ShellExecute(HWND hWnd,LPCSTR lpOperation,LPCSTR lpFileName,LPCSTR lpParameters, LPCSTR lpDirectory,int nShowCmd)    HWND hWnd: {用于指定父窗体句柄。当函数调用过程出现错误时,它将作为Windows消息窗体的父窗体。比如,能够将其设置为应用程序主窗体句柄,即 Application.Handle,也能够将其设置为桌面窗体句柄(用GetDesktopWindow函数获得}    LPCSTR lpOperation: 用于指定要进行的操作: open、print、edit、explore、find “open”操作表示运行由FileName參数指定的程序,或打开由FileName參数指定的文件或目录; “print”操作表示打印由FileName參数指定的文件; “explore”操作表示浏览由FileName參数指定的目录。 edit  编辑; find  搜寻; 当參数设为nil时,表示运行默认操作“open”;    LPCSTR lpFileName: 用于指定要打开的文件名称、要运行的程序文件名称或要浏览的目录名。   

ShellExecuteEx function always returning error code 5 (C++)

假如想象 提交于 2019-12-25 04:19:18
问题 I need to start a process and have access to the PID, so I am trying to use ShellExecuteEx. I am attempting to open a batch file. However, no matter how I pass the parameters and no matter where the file is located and what permission's I have on the file, the function is returning with Error Code 5: Access is denied. The File is located in the same location as the config files that have already been read successfully. The File is set for full access permissions with any user. It does this

ShellExecute(Ex) with 'properties' verb

非 Y 不嫁゛ 提交于 2019-12-25 04:15:56
问题 I am trying to write a program, that opens the properties of a file, from the command-line. I read that it is possible to do, using either of the functions ShellExecute and ShellExecuteEx, with the 'properties' verb. So, I wrote such a C++ program in Visual Studio for Windows 10. This is that program: #include <windows.h> #include <iostream> void ShowFileProperties(char *); int main(int argc, char **argv) { if (argc >= 2) { std::cout << argv[1] << std::endl; ShowFileProperties(argv[1]); } std

npm failing right after installing Node.js

老子叫甜甜 提交于 2019-12-25 02:59:18
问题 I'm working on an installer which automates the installation of Node.js, extracts a node application to a folder, and then installs it via npm install . However, the installer always needs to be run twice in order for npm to work. This is installing onto Windows. During the lifetime of my installer app... If Node.js wasn't already installed, it gets installed In the same process, steps later, npm install is executed If Node.js didn't already exist before installer started, it fails saying npm

How to execute an executable from Linux with javascript

送分小仙女□ 提交于 2019-12-24 16:01:29
问题 I'm making an application for D-bus in javascript. I need to call an executable from the javascript code and I know that it's possible to do it in Windows like this var activeXObj = new ActiveXObject("Shell.Application"); activeXObj.ShellExecute("C:\\WINDOWS\\NOTEPAD.EXE", "", "", "open", "1"); But...how to do the same in Linux?? Thanks a lot P.S: Is not for a browser =) 回答1: Install node.js (depending on your distro, sudo apt-get install nodejs ) and use the ChildProcess module to execute

how to tell when an external application ends in delphi

六眼飞鱼酱① 提交于 2019-12-24 00:56:51
问题 I am using ShellExecute to run external application How can i tell when the external application ends ? Here my code theProgram := 'MySql.exe'; itsParameters := ' -u user1 -ppassword -e "create database abc"’; rslt := ShellExecute(0, 'open', pChar (theProgram), pChar (itsParameters), nil, SW_SHOW); 回答1: Try the following function. WaitForSingleObject does what you need. function ExecAppAndWait(const sApp, sParams: String; wShow: Word; sCurrentDirectory: String = ''): DWord; { Parameter wShow: