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.

497 questions
9
votes
1 answer

Best way to read output of shell command

In Vim, What is the best (portable and fast) way to read output of a shell command? This output may be binary and thus contain nulls and (not) have trailing newline which matters. Current solutions I see: Use system(). Problems: does not work with…
ZyX
  • 49,123
  • 7
  • 101
  • 128
9
votes
3 answers

OSX equivalent of ShellExecute?

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!
twk
  • 15,310
  • 21
  • 68
  • 95
9
votes
3 answers

Wait before ShellExecute is carried out?

I have a hopefully quick question: Is it possible to delay execution of ShellExecute a little bit? I have an application with autoupdater. After it downloads all necessary files etc, it renames current files to *.OLD and the new as the previous.…
Martin Melka
  • 5,854
  • 10
  • 60
  • 114
9
votes
1 answer

What is the difference between Shell and ShellEx in Windows Registry?

I'm trying to add a custom context menu in windows registry, I found a shell key and shellex key that seems to both work the same thing? Why is there 2 and what are they for?
Chopnut
  • 527
  • 7
  • 20
8
votes
4 answers

How to avoid confirmation message when executing a .reg file with shellexecute command

In my program I check for a registry key at startup and if somehow it does not exist I execute the reg file located in the application folder wit the help of ShellExecute command. How can I avoid getting confimation messages when executing this…
Mikayil Abdullayev
  • 11,458
  • 22
  • 103
  • 189
8
votes
3 answers

shellexecute fails to open http links for some users

Some users of an app of mine are reporting links dont open in the browser. I always launch them with shellexecute(0, 'open', 'http://... what could I check for an incorrect(?) setting in the http link associations?
hikari
  • 3,174
  • 27
  • 64
8
votes
4 answers

shell_exec() timeout management & exec()

I'm running a third party script by using a wrapper class I've written which calls shell_exec() and pipes into a file I parse later using php code. I should mention that this is working, but I am trying to enhance the functionality, having…
David Yell
  • 11,513
  • 11
  • 59
  • 95
8
votes
2 answers

ShellExecute fails if run from elevated process and non-default browser set in Windows 8 RTM

Set non-default browser in Windows 8 RTM (Chrome, Firefox) and try to run code like this: ShellExecute(NULL, "open", "http://stackoverflow.com", NULL, NULL, SW_SHOWNORMAL); It's ok. But then change manifest to require Administrative priveleges or…
Brun
  • 349
  • 3
  • 9
7
votes
3 answers

How to execute an app without elevation?

I want to invoke an updater to check for updates (not to actually do the update but only check if there is any). I would like to do this in the background and silently. If there is an update, I would ask the user for elevated permissions and run the…
Tamás Szelei
  • 21,352
  • 16
  • 94
  • 169
7
votes
2 answers

Execute command line via php?

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…
XS07
  • 71
  • 1
  • 1
  • 3
7
votes
1 answer

How to execute a file with a different extension's associated application?

In my application, I would like to be able to execute a file with an arbitrary name and extension using the program associated with a different extension. For example, say I have a file called file.dat, but I wanted to open it with Notepad, as if it…
Martijn
  • 12,254
  • 3
  • 46
  • 58
7
votes
3 answers

How can I pass more than one command line argument via c#

I need to pass more than one command line argument via c# for a process called handle.exe: http://www.google.com.mt/search?sourceid=chrome&ie=UTF-8&q=handle.exe First, I need to run the executable file via ADMINISTRATOR permissions. This post has…
steffar
  • 259
  • 5
  • 8
6
votes
1 answer

Passing 'open' to ShellExecute doesn't open a word file on a specific machine

I use ShellExecute to open files. On a single machine among 2000+ users I cannot open doc files. docx are opened with Wordpad. Word 2010 is correctly installed and from explorer double cliicking on a word file opens word correctly, moreover the doc…
LaBracca
  • 13,941
  • 34
  • 129
  • 224
6
votes
1 answer

Kotlin native - Execute an executable

I am trying to execute a command via bash, for example konanc. In KotlinJVM this would just be using Runtime.getRuntime().exec("..."), or creating a Process using the ProcessBuilder, however, none of those classes are available in Kotlin-Native, as…
Marcel
  • 1,232
  • 1
  • 14
  • 32
6
votes
1 answer

Longer execution through Java shell than console?

I have a script in Python which do some computations. When I run this script in console it takes about 7 minutes to complete but when I run it thought Java shell it takes three times longer. I use following code to execute the script in Java: this.p…
czuk
  • 5,638
  • 10
  • 32
  • 47
1 2
3
33 34