Questions tagged [shellexecuteex]

A Windows shell function used to perform action(s) on a file system object. Differs from the basic shell execute/run and ShellExecute functions in that it utilizes the SHELLEXECUTEINFO structure.

ShellExecuteEx is a Windows shell function that performs an operation on a specified file system object. In contrast to the ShellExecute function, it only takes a single parameter, which is a pointer to a SHELLEXECUTEINFO structure. This structure combines multiple input and output parameters.

75 questions
1
vote
0 answers

Python: Running just parts of an automation script in elevated mode

I'm running some automation tests, and some parts have to be run in elevated mode to work. Which is fine; I'm using shell.ShellExecuteEx from the pywin32 library to call my own scripts, and that works just fine. These are the exact parameters I am…
Richard
  • 494
  • 7
  • 18
1
vote
0 answers

Unable to send parameters to cmd.exe through ShellExecuteEx()

I want my MFC-C++ program to open cmd.exe and run 7-zip in command line which takes in several parameters. SHELLEXECUTEINFO ShRun = {0}; ShRun.cbSize = sizeof(SHELLEXECUTEINFO); ShRun.fMask = SEE_MASK_NOCLOSEPROCESS; ShRun.hwnd =…
yath
  • 355
  • 1
  • 4
  • 14
1
vote
2 answers

c++ createprocess as administrator and get its output

I have a problem, I have been looking for two things that must go together, running a process through Createprocess() as an administrator and get the output. When I Google how to CreateProcess() as an administrator I get people replying to use…
Maposa Takalani
  • 338
  • 1
  • 5
  • 17
1
vote
2 answers

UI Automation doesn't see hidden windows?

I have winforms application that is signed and has manifest with level="requireAdministrator" uiAccess="false". I want to start another application with hidden window and to work with it using UI Automation API. Process procinst = new…
mmm
  • 61
  • 1
  • 9
1
vote
1 answer

Executing an EXE from an EXE from an EXE

I have 3 programs, App1.exe, App2.exe, and App3.exe. Each can be run independently from one another, but App2.exe may run App3.exe using ShellExecuteEx, and App1.exe may run App2.exe using ShellExecuteEx (which in turn may run App3). App3 has…
1
vote
1 answer

ShellExecuteEx & GetExitCodeProcess - Handle Invalid or Segmentation Fault

I'm trying to start an application and then monitor it until it closes. I'm using ShellExecuteEX and GetExitCodeProcess and having several problems. The code below causes a segmentation fault when GetExitCodeProcess is Called. If I change…
rreeves
  • 2,408
  • 6
  • 39
  • 53
0
votes
0 answers

Why does ShellExecuteEx with verb "print" take LNK file settings of an app into account?

Context I have a Windows app printing PDF files by forwarding the file paths to ShellExecuteEx and the verb print. Adobe Reader is installed and registered for that verb. Reader by default creates a LNK shortcut file in the start…
Thorsten Schöning
  • 3,501
  • 2
  • 25
  • 46
0
votes
1 answer

Insert (dynamic) command string in ShellExecute function in C++

Using C++ (on Windows 10), I'm trying to execute a command in cmd.exe that execute a python file that takes in another file (in csv format). What I would like to do is the same thing as if I were typing on the command line something like…
Alinik
  • 33
  • 2
0
votes
1 answer

Process.WaitForExit(n) won't wait immediately after Process.Start()

Code: using p = new Process(); p.StartInfo.UseShellExecute = true; p.StartInfo.Verb = "printto"; …
Joshua
  • 40,822
  • 8
  • 72
  • 132
0
votes
0 answers

How print Document in order using python?

I am using win32api python package for printing document. I have two different folders on the basis of print type. Folder 1 for single side print and Folder 2 for double side print. That was obtained by win32api package but the problem is sequential…
raviraj
  • 335
  • 4
  • 19
0
votes
1 answer

Execute tregsvr.exe through Delphi with parameters

I am using the tregsvr.exe program that comes with Delphi to register an OCX. The reason for using this program instead of regsrv32.exe is that a -c parameter can be passed which would allow registration only for the current user. I execute the…
Sierra
  • 103
  • 1
  • 5
0
votes
1 answer

ShellExecuteEx and getexitcodeprocess

Using ShellExecuteEx(..) to lunch a python script and python script returning a value from python main using sys.exit(0) on success or some other error value. How to read a python script exit code? After launching application waited to complete…
Jammy1
  • 11
  • 4
0
votes
1 answer

Unexpected/Inconsistent Behavior from ShellExecuteEx

I am creating self-configuring software tool that runs several other 3rd party installers as necessary, in Visual C++ (2015) using Qt. When the software finds it needs an unavailable library or driver, it will call the appropriate installer using…
xariswon
  • 1
  • 1
0
votes
1 answer

How do I programmitcally launch EXE by disabling compatibility mode?

User launches my EXE runs in compatibility mode which launches another EXE but I don't want the child EXE to inherit the compatibility mode settings. How do I achieve it? Cannot find any resources which makes this work. I tried…
Sam
  • 822
  • 2
  • 8
  • 30
0
votes
0 answers

How to use TerminateProcess() to close a console window

My C++ application starts a .cmd file as a child process like this: SHELLEXECUTEINFOA execInfo = {0}; execInfo.cbSize = sizeof(execInfo); execInfo.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_NOASYNC; execInfo.lpVerb = "open"; execInfo.lpFile =…
Stéphane
  • 19,459
  • 24
  • 95
  • 136