shellexecute

Open a Web Page in a Windows Batch FIle

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 16:02:16
I have a batch file that does a bunch of things and at the end needs to open up a web browser to a page. Is there a way to, in essence, call ShellExecute on a http to open the web page? Windows Command Prompt You can use the start command to do much the same thing as ShellExecute . For example start "" http://www.stackoverflow.com This will launch whatever browser is the default browser, so won't necessarily launch Internet Explorer. unfortunatly, the best method to approach this is to use Internet Explorer as it's a browser which is garunteed to be on Windows based machines. This will also

How to wait for ShellExecute to run?

放肆的年华 提交于 2019-11-28 07:26:40
I have manages to use ShellExecute in VC++ in order to launch a document. Now I wish to run a command-line tool that receives some arguments, and to run in the background (as hidden, not minimized) and let it block my program flow, so that i'll be able to wait for it to finish. How to i alter the command-line of: ShellExecute(NULL,"open",FULL_PATH_TO_CMD_LINE_TOOL,ARGUMENTS,NULL,SW_HIDE); The problem is, I have tool that converts html to pdf, and I wish that once the tool finished, aka pdf is ready, to have another ShellExecute to view it. Roger Rowland There is a CodeProject article that

ShellExecuteEx in VBA

自作多情 提交于 2019-11-28 06:16:55
问题 I understand how to use ShellExecute in VBA (for my Outlook macros) but I'm looking to be able to use ShellExecuteEx to wait for the executed program in my script. Does anyone have an example of how to do this? Currently I have this code: Const SW_SHOW = 1 Const SW_SHOWMAXIMIZED = 3 Public Declare Function ShellExecute _ Lib "shell32.dll" _ Alias "ShellExecuteA" ( _ ByVal Hwnd As Long, _ ByVal lpOperation As String, _ ByVal lpFile As String, _ ByVal lpParameters As String, _ ByVal lpDirectory

How to call PHP file from a shell script file [duplicate]

浪尽此生 提交于 2019-11-28 01:41:49
问题 This question already has an answer here: How to pass parameters from bash to php script? 3 answers I need a shell script which has a loop. In each loop iteration it needs to call a PHP file with some parameters. Is there any way to do it? 回答1: In your php file named test.php, for example <?php //like programs in c language, use $argc, $argv access command line argument number and arguments, uncomment below two line to dump $argc and $argv //var_dump($argc); //an integer //var_dump($argv); /

OSX equivalent of ShellExecute?

非 Y 不嫁゛ 提交于 2019-11-28 00:02:05
I've got a C++ app that I'm porting from Win32 to OSX. I'd like to be able to launch arbitrary files as if the user opened them. This is easy on windows using ShellExecute. How do I accomplish the same thing on the Mac? Thanks! You can call system(); in any C++ application. On OSX, you can use the open command to launch things as if they were clicked on. From the documentation for open: The open command opens a file (or a directory or URL), just as if you had double-clicked the file's icon. If no application name is specified, the default application as determined via LaunchServices is used to

Execute command line via php?

半世苍凉 提交于 2019-11-27 18:19:55
问题 How I can execute those two command line via php: wkhtmltopdf www.google.com gg.pdf & oofice -headless -nologo -pt cup-pdf my.doc they both return a pdf file and download into my home directory. I want to know the way to execute those command from my html page via php. Thanks. 回答1: You should take a look at the System program execution section of the manual : PHP provides several functions that can be used to launch external commands / programs, including : exec() -- which can store the

Exec a shell command in Go

﹥>﹥吖頭↗ 提交于 2019-11-27 18:08:50
I'm looking to execute a shell command in Go and get the resulting output as a string in my program. I saw the Rosetta Code version: package main import "fmt" import "exec" func main() { cmd, err := exec.Run("/bin/ls", []string{"/bin/ls"}, []string{}, "", exec.DevNull, exec.PassThrough, exec.PassThrough) if (err != nil) { fmt.Println(err) return } cmd.Close() But this doesn't capture the actual standard out or err in a way that I can programatically access - those still print out to the regular stdout / stderr. I saw that using Pipe as the out or err could help elsewhere, but no example of how

Difference between Run() and ShellExecute()

半城伤御伤魂 提交于 2019-11-27 16:14:42
I want to execute something in a shell/terminal on Windows via AutoIt. And I know that there are two ways of doing it. For example: Run(@ComSpec & " /c " & $myCommand, "", @SW_HIDE) ;and ShellExecute($myCommand) I don't understand the difference; both functions will do what I want, but what's behind them? Which pros and cons do they have? Bookeater Run() is used to fire off executable files only. It requires the full path of the program. ShellExecute() also accepts content files like .txt, .htm and .docx and will start the executable associated with it. The verb option can be used to control

Open a Web Page in a Windows Batch FIle

人走茶凉 提交于 2019-11-27 09:30:55
问题 I have a batch file that does a bunch of things and at the end needs to open up a web browser to a page. Is there a way to, in essence, call ShellExecute on a http to open the web page? Windows Command Prompt 回答1: You can use the start command to do much the same thing as ShellExecute . For example start "" http://www.stackoverflow.com This will launch whatever browser is the default browser, so won't necessarily launch Internet Explorer. 回答2: unfortunatly, the best method to approach this is

How do I run a command-line program in Delphi?

a 夏天 提交于 2019-11-27 08:02:37
I need to execute a Windows "find" command from a Delphi software. I've tried to use the ShellExecute command, but it doesn't seem to work. In C, I'd use the system procedure, but here... I don't know. I'd like to do something like this: System('find "320" in.txt > out.txt'); Edit : Thanks for the answer :) I was trying to run 'Find' as an executable, not as argument for cmd.exe. An example using ShellExecute() : procedure TForm1.Button1Click(Sender: TObject); begin ShellExecute(0, nil, 'cmd.exe', '/C find "320" in.txt > out.txt', nil, SW_HIDE); Sleep(1000); Memo1.Lines.LoadFromFile('out.txt')