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
4
votes
1 answer

Is it possible to specify shell verbs at the command line?

Using ShellExecute API you can specify a verb, e.g. 'open' or 'print'. Is it possible to do the same thing from the command line?
snowdude
  • 3,854
  • 1
  • 18
  • 27
4
votes
1 answer

ShellExecute (and ShellExecuteEx) do nothing with my URL

I'm creating a project with C++Builder XE7, in which a user can click on a button to open a web link, e.g. to open a support page, or to share his experience on a social media. For that, I use the ShellExecute() function, and it works well, except…
Jean-Milost Reymond
  • 1,833
  • 1
  • 15
  • 36
4
votes
1 answer

Is there any problem to using this code in a Thread ? (Delphi)

i use this code in a thread (through Indy Onexecute event) . is there any problem ? function TFrmMain.ShellExecute_AndWait(FileName, Params: string): bool; var exInfo: TShellExecuteInfo; Ph: DWORD; begin FillChar(exInfo, SizeOf(exInfo), 0); …
Kermia
  • 4,171
  • 13
  • 64
  • 105
4
votes
2 answers

Executing AutoIt script from command prompt

Is there any way to execute my AutoIt script (.au3 file) from command line?
name_masked
  • 9,544
  • 41
  • 118
  • 172
4
votes
1 answer

Difference between Run() and ShellExecute()

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;…
mtzE
  • 57
  • 1
  • 6
4
votes
3 answers

Python win32 ShellExecute error 31: 'A device attached to the system is not functioning.'

I have a python program where I try to send a document to a printer. It works fine in my machine with a local printer set as the default printer and connected with my laptop via USB. However, when I tried it with another computer with its default…
Ignacio
  • 386
  • 4
  • 19
4
votes
2 answers

Execute command from java which might include spaces

I am trying to execute the following command from a java program: java -jar /opt/plasma/fr.inria.plasmalab.plasmalab-1.3.4.jar -t -a montecarlo -A"Total samples"=1000 -m models/translated/plasma/NaCl2.rml:rml --format csv -r…
4
votes
3 answers

WOW64 woes (.lnk shortcuts)

I'm using Windows 7 (x64) and Delphi 2010. I'm writing a component that will emulate the start menu. However, I've run into the following problems: If I attempt to open a shortcut (.lnk file) with ShellExecute, this will fail whenever…
4
votes
2 answers

Error running exec(). Command: Working Directory: null Environment: null - how to execute a binary in Android correctly on a non-rooted device?

I want to run an executable on a non-rooted android device. Using the following commands in java Runtime.getRuntime().exec("/bin/chmod 744…
user2212461
  • 3,105
  • 8
  • 49
  • 87
4
votes
0 answers

How can I programatically force Windows XP to display thumbnails for a folder?

I have an application that calls ShellExecute with a folder path. This brings up the folder in explorer. However, I want to make sure that the folder is set to display the contents in thumbnail view. How can I ensure this happens?
Nathan Osman
  • 71,149
  • 71
  • 256
  • 361
4
votes
1 answer

VBA: Running "Elevated" Command (Shell vs. ShellExecute)

In my VBA procedure, I need to run the app "Skitch" and use it to open a JPEG file. This is the command I've been using: ReturnValue = Shell("C:\Program Files (x86)\Evernote\Skitch\Skitch.exe " & """" & aPic & """", 1) ...where "aPic" is the path…
Shawn V. Wilson
  • 1,002
  • 3
  • 17
  • 42
4
votes
3 answers

Open default browser as standard user (C++)

I'm currently using ShellExecute "open" to open a URL in the user's browser, but running into a bit of trouble in Win7 and Vista because the program runs elevated as a service. When ShellExecute opens the browser, it seems to read the "Local Admin"…
Disco
  • 515
  • 1
  • 6
  • 14
4
votes
3 answers

Good quality code example of how to call an application and wait for it to exit

Using: Delphi XE2; Windows 32-bit VCL application From within my Delphi application, I need to call an application using ShellExecute and wait until it finishes before proceeding. I see many examples here on SO of ShellExecute with…
Steve F
  • 1,527
  • 1
  • 29
  • 55
4
votes
2 answers

How to execute a VS2008 command from Python and grab its output?

I wish to run tf changeset 12345 Using the Visual Studio 2008 Command tool. It is located in: "c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\" and the command that gets launched is: %comspec% /k ""c:\Program Files (x86)\Microsoft Visual…
Hamish Grubijan
  • 10,562
  • 23
  • 99
  • 147
4
votes
4 answers

Piping data to a file with the windows ‘ShellExecute’ function

I am using the ‘ShellExecute’ function in windows vista Is there any way to pipe the output to a file? i.e. MySqlDump.exe '-u user1 -ppassword dbName > TheOutputFile.Sql Here my code theProgram := 'MySqlDump.exe'; itsParameters := '-u…
Charles Faiga
  • 11,665
  • 25
  • 102
  • 139