Questions tagged [shellexecute]

ShellExecute is a Win32 API function used to launch document files

ShellExecute is a Microsoft Win32 API function used to launch document files.

Depending on the type of document file, it will do this through:

  • Creating a process using the executable file associated with the specified document
  • Using the COM subsystem to request a shell extension to launch the document
  • Initiating an action to be completed by the end-user, such as a search

As a rule of thumb, it can be assumed that invoking ShellExecute on a document file will have the same result as double-clicking on that file in Windows Explorer, including displaying user interface elements.

521 questions
5
votes
5 answers

Executing .exe from Visual Basic 6

I'm new to visual basic. I'm trying to execute .exe file from VB. But I'm not getting the output. My .exe is having command line args. Following is my code Private Sub Command1_Click() Shell "D:\FEP\extractFEPData.exe data.txt",…
ulaga
  • 93
  • 1
  • 5
  • 11
5
votes
1 answer

ProcessStartInfo.UseShellExecute = true and waiting for process exit

I want to use shell executable in order to respect user preferences of application to be started, but I also need to know when that particular application is closed. Process editProcess = new Process(); ProcessStartInfo startInfo = new…
mostlytech
  • 814
  • 9
  • 13
5
votes
3 answers

how come we need not close the handle returned by ShellExecute?

On success, ShellExecute returns a handle. Do we need to close this handle, and if so, how ? According to examples published my Microsoft, we need not close this handle. But the doc of ShellExecute itself is mute on the subject. Can you confirm we…
user192472
  • 715
  • 7
  • 15
5
votes
4 answers

ShellExecute fails for local html or file URLs

Our company is migrating our help systems over to HTML5 format under Flare. We've also added Topic based access to the help systems using Flare CSHID's on the URI command line for accessing the topic directly, such as index.html#CSHID=GettingStarted…
WebDrive
  • 1,248
  • 12
  • 19
5
votes
2 answers

How to determine if win32api.ShellExecute was successful using hinstance?

I've been looking around for an answer to my original issue.. how do i determine (programmatically) that my win32api.ShellExecute statement executed successfully, and if a successful execution occurs, execute an os.remove() statement. Researching…
CyberSamurai
  • 179
  • 1
  • 10
5
votes
3 answers

Getting rid of the evil delay caused by ShellExecute

This is something that's been bothering me a while and there just has to be a solution to this. Every time I call ShellExecute to open an external file (be it a document, executable or a URL) this causes a very long lockup in my program before…
korona
  • 2,308
  • 1
  • 22
  • 37
5
votes
1 answer

Whether Shellexecute will share environment variable with launching process

Program 1 uses SetEnvironment and calls ShellExecute to launch Program 2. Program 2 calls GetEnvironment and retrieves value from it. Surprisingly this is working as i have read in MSDN, SetEnvironment is process specific (at least in my case).…
Vikas
  • 51
  • 3
5
votes
4 answers

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…
Lasse V. Karlsen
  • 380,855
  • 102
  • 628
  • 825
5
votes
1 answer

Shellexecute Return Value error messages

I'm getting the return value when I call ShellExecute - an integer. Where can I get the associated error messages? I know they're general, but I've seen messages in the MS documentation.
Patrick Moloney
  • 642
  • 5
  • 14
5
votes
2 answers

ShellExecute failing if spaces in Path

I have a Delphi application that uses ShellExecute to call a second Delphi Application on a button press. The applications are stored on the same server, on the same network share. Their paths are in the format: const JobManager =…
Dan Kelly
  • 2,634
  • 5
  • 41
  • 61
5
votes
3 answers

Why Desktop.Open() doesn't work with MagicISO being installed

Here's my code if (Desktop.isDesktopSupported()) { Desktop desktop = Desktop.getDesktop(); if (desktop.isSupported(Desktop.Action.OPEN)) { try { desktop.open(file.getCanonicalFile()); } catch (Exception ex) { …
Hendra Jaya
  • 1,608
  • 11
  • 15
4
votes
7 answers

Open a URL in a new browser process

I need to open a URL in a new browser process. I need to be notified when that browser process quits. The code I'm currently using is the following: Process browser = new Process(); browser.EnableRaisingEvents = true; …
Gordon
  • 3,012
  • 2
  • 26
  • 35
4
votes
1 answer

ant java task : redirecting output with spawn=true

Greetings, a rather clear question here. I have to launch a java job with , which is to be run in parallel with ant and it's okay if the job outlives the ant process, hence spawn="true". I have to see the job output in a designated file. This…
Anton Kraievyi
  • 4,182
  • 4
  • 26
  • 41
4
votes
3 answers

Error when unoconv command is run as apache

Below is the error I am getting when unoconv command is run as apache, with root it works fine. [root@tux1 apache]# sudo -u apache unoconv -f pdf /var/www/html/testing/example.xlsx creation of executable memory area failed: Permission denied …
Raghunath
  • 61
  • 1
  • 5
4
votes
3 answers

cmd commands in ShellExecute

I am trying in execute netsh winsock reset catalog command in command prompt from an elevated(has admin privileage) c++ application. HINSTANCE retVal = ShellExecute(NULL, "open", "cmd", "\c netsh winsock reset catalog > CUninstall.log", NULL,…
Akhil V Suku
  • 870
  • 2
  • 13
  • 34