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
-1
votes
2 answers

Can not open .exe with shellExecute function in C++

i want to open a .exe (lets call it A) when i execute another c++ program (lets call it B), so i have A and B in execution at the same time. For this, i use this function in B code: HINSTANCE…
Maiser
  • 65
  • 1
  • 10
-1
votes
2 answers

Can Window's ShellExecute function accept WSF script arguments?

The batch hybrid script below aims to auto invoke Administrator privileges before running some tasks requiring elevated rights. It does popup the UAC prompt, but regardless of the user choice Admin privileges aren't granted. I wonder if Window's…
sambul35
  • 1,058
  • 14
  • 22
-1
votes
3 answers

Open an additional program with c++ on Mac [XCode]

I want to open an additional program with c++ on XCode. It is Firefox. But if I make Shell Execute("file://localhost/Applications/Firefox.app"); There is an error 'ShellExecute' was not declared in this scope In other forum there was a clue to…
Korne127
  • 168
  • 14
-1
votes
1 answer

Why does ShellExecute not work with LPCSTR variable containing file path?

After researching the whole week every day (since previous Monday, 2016-05-30), having tested various "solutions" and having built program hundreds of times, I finally managed to write this code which does not throw any errors or warnings and should…
-1
votes
1 answer

ShellExecuteEx and WaitForSingleObject paint corruption to window under

Using the following code to update my application with an external exe file, I get paint corruption (not update or refresing) to window under -which is the main app and the caller- when I move this window. It seems that under Windows 7 works fine…
Maverick
  • 1,105
  • 12
  • 41
-1
votes
1 answer

ShellExecute doesn't work for other computer

I made a program using Win32Api. In the program, it has "ShellExecute" phrase in order to execute chrome for searching. Following is a abstraction fo what i wrote. #include #include int main () { ShellExecute(NULL,…
mogandaz
  • 1
  • 2
-1
votes
2 answers

Trying to open up a url address with an executable

I'm trying to open a user input url using ShellExecute in my c++ project but am finding difficulty in creating a main function within the project. Currently I have #include #include #include int findIE(const…
koala421
  • 786
  • 3
  • 11
  • 27
-1
votes
1 answer

What is the difference between ShellExecute and CMD commands, if any?

Execution wise, is any difference between those two commands, except the fact that the one is for C++ and the other is the CMD? Because I'm having a strange problem, I have an .exe that it takes arguments. When I call this exe with it's arguments…
-1
votes
1 answer

Running an external program using ShellExecute

As far as i know ... You need to set the executable program in ShellExecute (like notepad.exe) but what if the user wants to use other external program (like notepad++.exe) to open the file? if this is possible then how will i do that?
Rhacel
  • 1
  • 1
-1
votes
1 answer

Opening a text in notepad in MFC

Just as the title stated. How do I open a text in notepad in MFC? I used the CFileDialog to open up a "Save As" dialog box like so : TCHAR szFilters[] = _T ("Text files (*.txt)¦*.txt¦All files (*.*)¦*.*¦¦"); CFileDialog dlg (FALSE, _T ("txt"),…
Ashton
  • 83
  • 1
  • 3
  • 12
-2
votes
1 answer

Ansible error Shared connection to myhost1 closed. when using raw module

My ansible target server is SunOS. I get Ansible error Shared connection to myhost1 closed. when using raw module. The error does not show when i change module to shell however, the execution of script start.sh does not happen (evident from outout…
Ashar
  • 2,942
  • 10
  • 58
  • 122
-2
votes
1 answer

running a custom files in C

I want to run a custom file test.exe. I tried ShellExecute() and system(), but it did not work. How could i fix this? code: #include #include int main() { system("C:\\Users\\user\\test.exe"); } The code AND the next code…
-2
votes
2 answers

Unable to execute the If condition in shell script

I need to check if container is already present with specific name. Using if statement for same, however container is present with same name but i am not sure why if statement is not running successfully. if [`echo password | sudo -S docker ps…
J.vik
  • 103
  • 2
  • 11
-2
votes
1 answer

How to call ShellExecute to open a file with specific program using C++ without associating same file extensions

I read MSDN and tried this line of code ShellExecute(handle, "open", "fully_qualified_path_to_file", NULL, NULL, SW_SHOWNORMAL); It works fine, but I need some more functionality. I wrote an app, which makes output in file with .bin extension. On…
evg256
  • 1
  • 2
-2
votes
2 answers

Why doesn't my command run like I expected when I use ShellExecute?

I am trying to dump a PDF to text using a command line utility (It works with tests from dos command line) from my Delphi code. Here is my code if fileexists(ExtractFilePath(Application.ExeName) + 'pdftotext.exe') then begin …
IElite
  • 1,818
  • 9
  • 39
  • 64
1 2 3
34
35