shellexecute

Waiting for ShellExecuteEx (Setting access rights on Windows process)

Hi, I'm using the ShellExecuteEx function in a C++ program to launch an Uninstall.lnk file. In my program, I'd like to wait for the uninstaller to finish. My first attempt was to set the SEE_MASK_NOCLOSEPROCESS flag in the SHELLEXECUTEINFO structure and then call WaitForSingleObject on the hProcess handle available in the SHELLEXECUTEIN...

how to consume a rest web service from SQL Server.

I have the following scenario some real basic rest web service mainly, I'm just checking the existence of a single record, it's just a single validation, I'm not moving around hundreds of rows... that should be called from sql 2005, sql 2008... and yes sql 2000 and sql 6.5 (ouch!) I guess with sql 2005 and 2008 I could implement an as...

Linux command within Javascript or PHP

I have a linux command line that I need to execute witin either PHP or Javascript (PHP preferred.) The command is keygen AB3554C1D1971DB7 \pc_code 365 However, I would like to substitute the \pc_code with a string like $pccode where user enters the generated PC Code. This is for a legit project, but having a problem with creators of...

Which reasons could make ShellExecute fail?

I have a VB6 application which opens files with their associated application using: ShellExecute(0, "open", filename, params, vbNullString, vbNormalFocus) This works perfectly. Now I got a customer (running XP with Adobe Reader) who can't open any PDF file using the above command. But the same file is being opened without any proble...

Open an html page on an install CD with the default browser

I am trying to build an install CD with a custom MFC application set to autorun when the CD is inserted. The instructions are included as a simple html page with images and links to PDF documents, all of which are located on the CD. In the past I'd used the following to open the html page with the default browser: ShellExecute(NULL, "...

How to find if an document can be OPENed via ShellExecute?

I want to check if a particular file can be successfully "OPEN"ed via ShellExecute, so I'm attempting to use AssocQueryString to discover this. Example: DWORD size = 1024; TCHAR buff[1024]; // fixed size as dirty hack for testing int err = AssocQueryString(0, ASSOCSTR_EXECUTABLE, ".mxf", NULL ,buff , &size); openAction->Enabled = ((...

error executing shell script in PHP

I am trying to execute a shell command via: <php echo shell_execute("tac /home/kusmuk/access-logs/kusmuk.org"); ?> But it does not give any output. What could be the reason? Although it does not work, the following lines work as expected: <php echo shell_execute("ls -al triogrup.com"); ?> //outputs: -rw-r----- 2 root kusmuk 28640 Au...

ShellExecuteEx in VBA

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 "she...

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

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' ...

How to Execute/ShellExecuteEx/InvokeCommand ITEMIDLIST pointing to Shell objects ?

I'm building a kind of dock, and I struggle at finding how to save things like "Run", "Search", "Help", "Printers" and reopen them after that. I tried this : CComPtr<IShellFolder> pDF; SHGetDesktopFolder(&pDF); LPITEMIDLIST pidlPrintersAndFaxes=0; hr=pDF->ParseDisplayName(0, 0, L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3...

How can I redirect all shortcuts to a given executable? Is there any equivalent to a symlink on Windows?

I am working on a program which includes a general purpose engine, some program specific content, and a custom automatic updater to handle updating the many gigabytes worth of media in our content as efficiently as possible. In a recent release of the engine, we have reorganized our directory structure, such that instead of the executabl...

Executing another program from C#, do I need to parse the "command line" from registry myself?

From the registry, for a given file type, I get a string containing something like this: "C:\Program Files\AppName\Executable.exe" /arg1 /arg2 /arg3 or sometimes: "C:\Program Files\AppName\Executable.exe" /arg1 /arg2 /arg3 "%1" In order for me to execute this program, and pass along a filename as a parameter (which I know it accept...

run a ruby script from delphi via shellexecute

I've written a little ruby script that lets me send emails by calling it along with some command line parameters. At the command line, this works: ruby.exe mail_it.rb fromaddr="[email protected]" tolist="[email protected]" But try as I may, I can't get it to work in Delphi 2007 for Win32. Here's the latest attempt: procedure TF...

ShellExecute and notifying the event of closing the launched file in c program

I have opened a .doc file in internet explorer using ShellExecute() in a c program.Is there any way that program which has called ShellExecute() gets notified when the opened file in the explorer is closed? ...

Random Delay When Printing to Dymo LabelWriter Turbo Via ShellExecute() [Solved]

I have an external program which takes in a few arguments (PrintLabel) which is called from my application using ShellExecute. PrintLabel is shown below. Sometimes it can take upwards to 15 to 20 seconds to print a label. It seems to get worse over time. If the PC is rebooted, then the printing speeds up again but it gets slower over tim...

ShellExecute + runas with quotes (") in parametees, fails to call the executable/batch

I have tried calling a batch file with elevated permissions. For that I have called fallowing function: (ref - http://msdn.microsoft.com/en-us/library/bb762153%28VS.85%29.aspx) ShellExecute(this->GetSafeHwnd(), L"runas", strExecutable, strParams, 0 , SW_SHOW); The call successfully launches the exexutable, but if I add quotes to my par...

When could ShellExecute fail? (Delphi)

Hello, I am planning to use ShellExecute for the updater of an application written in delphi 2007, I was wondering if ShellExecute will work on most computers with Win or if it can easly fail because of some user permission or something like that. ...

ShellExecute hangs - waiting for response to DDE broadcast?

This problem is related to the Evil delay question, except that my delay is not in launching the application but in waiting for ShellExecute to return. I have a small dialog application (Win32, written in VC++ 6, running on WinXP) that spawns a worker thread which writes to a logging text file. The thread exchanges information with the m...

How can a Delphi Program send an Email with Attachments via the DEFAULT E-mail Client?

Within my program, I am composing an email to send using the default e-mail client software installed on a user's machine. I have composed the mailto address, the subject, the multilined body, and I have several attachments to be included. I almost got this working using mailto and ShellExecute as follows: Message := 'mailto:someon...

How to run a programme from MySQL?

mysql > path_to_bin/name.exe Is there a solution? ...