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

Access hangs on WScript.Shell.run

I am using WScript.Shell to run a third party executable that reads a file and sends some data. Dim objShell As Object, Shellerror As Long Set objShell = CreateObject("WScript.Shell") The problem is, that Access hangs on the .run…
Miha
  • 13
  • 3
0
votes
2 answers

C++ ShellExecute msg issue

I have a .bat file which sends a local message. When I run it myself (double-click) it works (a message pops out). It doesn't work when I launch the .bat with ShellExecute(); though. What could be the case? Here's the code: message.bat msg *…
gregjj2
  • 1
  • 3
0
votes
3 answers

command is not running from php script using shell_exec() or system() or exec() functions

I am working on Windows server and able to run command from command prompt c:> %convertxls% {some args....} But when I run same command from php script *shell_exec(%convertxls% ..... 2>&1);* it gives me error as %convertxls% is not recognized…
Kammy
  • 409
  • 1
  • 7
  • 26
0
votes
1 answer

Error Expanding Script Generated Classpath for Java in PowerShell Script

Synopsis: I am trying to convert a shell script from UNIX to Powershell. The script cannot "hardcode" the path, but must instead list a directory to dynamically build the path at runtime. Also, the script must pass in 1 parameter to indicate the…
Q Boiler
  • 1,187
  • 9
  • 20
0
votes
1 answer

How to implement "Open With" command using ShellExecuteEx and wait for it to finish?

Seemingly simple task: I want to open the standard Windows dialog for picking the application to be used for opening the file, and then wait for this application to finish. The internet tells that ShellExecuteEx is the way to go. Ok, so here's the…
Alex Jenter
  • 4,324
  • 4
  • 36
  • 61
0
votes
3 answers

How to get the Handle that is executed in winexec or shellexecute?

i use to create a custom function like winexec(...):Hwnd that will retun the handle of executed application. i did use the findwindow() but having problem if it change window caption.
XBasic3000
  • 3,418
  • 5
  • 46
  • 91
0
votes
0 answers

Get the process id of ShellExecute

I have been searching all day to find a solution to this problem. I have 2 Excel instances (2 times launched) and in one a batch process is running to create a pdf file. If I use ShellExecute to start the conversion then the focus is not switched to…
0
votes
2 answers

Shell script to copy files

If there exist a directory, /backup/ And the files in it are a.gz b.gz c.gz And another directory /backup-directorybackup And the files in it are a.gz I need a shells script to compare two directories if the files are present then ignore it and…
Hulk
  • 32,860
  • 62
  • 144
  • 215
0
votes
1 answer

How to find out if process created with ShellExecuteEx owns a window?

I'm using ShellExecuteEx to run external application: SHELLEXECUTEINFO shExInfo = { 0 }; shExInfo.cbSize = sizeof(shExInfo); shExInfo.fMask = SEE_MASK_NOCLOSEPROCESS; shExInfo.hwnd = 0; shExInfo.lpVerb = L"runas"; //…
Amadeusz
  • 1,488
  • 14
  • 21
0
votes
1 answer

I want to open websites through shellexecute() by variable by assigning the variable with web-address in c

I want to open a webpage through shellexecute() in c. shellexecute() works fine if I give the web-address before but if I wanted to change that web-address,what should I do? Here the example: ShellExecute(NULL, "open", "rundll32.exe",…
SkrewEverything
  • 2,393
  • 1
  • 19
  • 50
0
votes
1 answer

Problems writing a WSUS-Program in AutoIt using Powershell

I am new to WSUS, Powershell and AutoIt. I am writing a program to approve multiple updates just with a few clicks (instead of 5 clicks per update and Group). Therefore i have a Powershell-Script that searches for all the computer-Groups and…
user4823001
0
votes
1 answer

Way to launch a browser w/ specific webpage without using ShellExecute? (Visual C++)

I want to add a button to my visual C++ form that will open with a specific browser. So far for links I've been using: System::Diagnostics::Process::Start("UrlHere") Which, as standard, opens with whatever your default browser is. I'm wondering…
tzepo
  • 13
  • 3
0
votes
1 answer

java getRuntime().exec() does not work

I am trying to use Java exec to run my Script and get the result and use it in my program. I have following lines of code. public static void main(String[] argv) throws Exception { Process p = Runtime.getRuntime().exec("phantomjs…
Suo6613
  • 431
  • 5
  • 17
0
votes
1 answer

Should path search order be identical for ::ShellExecute and static CFile::GetStatus() on relative path .EXE name?

From within my MFC App, I am doing something like CFileStatus fs; if (CFile::GetStatus("MyOtherProg.exe", fs)) { // found the file ::ShellExecute(NULL, NULL, "MyOtherProg.exe", NULL, NULL, SW_SHOW); } but the full path to the file found in…
franji1
  • 3,088
  • 2
  • 23
  • 43
0
votes
1 answer

C++ ShellExecute is not working the same way as cmd.exe

I'm running this command w_icrcom.exe j11 hola from a command prompt and it is working properly, the exe is running using the arguments. But when I'm doing the same from a C++ program the w_icrcom.exe is behaving differently. I'm getting an error…