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
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
  • 379
  • 5
  • 9
7
votes
3 answers

how to open a service properties dialog

I would like to add a button to my application ( frontend to a service) that will open the service properties dialog (like in services mmc snapin ) for my service. There are numerous examples to open file properties, but that is not what i want. i…
Lawrence Ward
  • 549
  • 1
  • 5
  • 17
7
votes
3 answers

Shellexec vs Exec vs Shellexec my batch file

I don't find in the help an exhaustive explanation of the difference between Shellexec and Exec. Is the Shellexec('','program.exe',params,'',SW_HIDE,ewWaitUntilTerminated,ResultCode) equivalent to…
lib
  • 2,918
  • 3
  • 27
  • 53
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
  • 6,218
  • 10
  • 36
  • 47
6
votes
2 answers

How to Print any document in a SELECTED printer

I would like to print any document such as pdf,word,excel or text files in a selected printer using .net .I have got success to do such printing in the default printer .The only issue now is to print in the selected printer. Here is the code for the…
Thunder
  • 10,366
  • 25
  • 84
  • 114
6
votes
1 answer

Need to execute a Shell Script from Angular JS UI

I need to execute a shell script on click of a button using Angular JS, can anyone tell me how can this be achieved ? I need to pass a few inputs(Parameters,Arguments) to that shell script before executing,from GUI/UI.
HulkSapien
  • 157
  • 2
  • 9
6
votes
4 answers

Python's win32api only printing to default printer

I'm trying to use win32api to output a PDF document to a particular printer. win32api.ShellExecute(0, "print", filename, '/d:"%s"' % printername, ".", 0) filename is a full pathname to the file, and printname is the name of the target printer I get…
Inaimathi
  • 13,853
  • 9
  • 49
  • 93
6
votes
1 answer

What are the parameters for "printto" using shellexecute?

I'm using Delphi's winapi ShellExecute to try to print to a user selected printer and not the default printer. I'm trying to figure out the syntax for a command using the printto verb. What would an example shell execute statement look like if I…
Peter Turner
  • 11,199
  • 10
  • 68
  • 109
5
votes
1 answer

How can I stop Chromium from creating a "WebViewHost" host window when launching the user's default web browser?

I am using the Chromium web browser control in my Delphi 6 application. Whenever the user clicks on a web link in the web page currently being displayed that is not on my primary web site I launch their default web browser with the URL, by opening…
Robert Oschler
  • 14,153
  • 18
  • 94
  • 227
5
votes
2 answers

Is it possible to run programs locally from a terminal services remote app?

First, I guess I'd have to figure out if I'm running remotely and second I'd have to figure out whether my remote connection is a standalone remote app or an app running on a terminal server (that may be tricky). But, once I've figured out all those…
Peter Turner
  • 11,199
  • 10
  • 68
  • 109
5
votes
2 answers

How do I open a file for edit from the command line under Windows?

How do I open a file for edit from the command line under Windows? Mainly I am looking to open the file in the default editor associated for it (not to be confused with default action for this filetype). This is different than just "executing" the…
sorin
  • 161,544
  • 178
  • 535
  • 806
5
votes
2 answers

Display file Properties > Security > Edit (permissions)

I successfully implemented the solution from How does one invoke the Windows Permissions dialog programmatically? and related: How to display file properties dialog security tab from c#. public static bool ShowFileProperties(string Filename) …
AbraCadaver
  • 78,200
  • 7
  • 66
  • 87
5
votes
5 answers

shell_exec does not run in the background, any other solution?

i'm using php in apache on CentOS. i'm need to serve users, that they can delete big files by click. trying to use shell_exec. but its not run in the background. it runs and make the user wait. my command : $D_command="rm -rf…
user692601
  • 107
  • 1
  • 3
  • 12
5
votes
3 answers

How can I launch Delphi 7 from an EXE file written in Delphi XE?

I'm doing some build automation and would like to run the Delphi 7 IDE from an Application that I'm writing using Delphi XE. My Delphi 7 IDE is at: 'C:\Program Files\Borland\Delphi7\Bin\delphi32.exe' yet doing: ShellExecute( Handle, 'Open',…
Brian Frost
  • 13,334
  • 11
  • 80
  • 154
5
votes
3 answers

How to programmatically open Run c++?

the question is how to open Run programmatically from c++? I know that have some function that can replace that, like shellexec, winexec but for some task I need just Run dialog to appear.
raptor
  • 265
  • 6
  • 20