shellexecute

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

Hi 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 user1 -ppassword dbName'; rslt := ShellExecute(0, 'open', ...

how to tell when an external application ends in delphi

Hi I am using ShellExecute to run external application How can i tell when the external application ends ? Here my code theProgram := 'MySql.exe'; itsParameters := ' -u user1 -ppassword -e "create database abc"’; rslt := ShellExecute(0, 'open', pChar (theProgram), pChar (itsParam...

Application Configuration File Not Being Read When Application Called via ShellExecute

Hi, I have a .NET application that is launched via a Delphi program using ShellExecute. Unfortunately when launched in this manner, the application does not seem to be reading its app.config file correctly, as if the file did not exist. I have tried testing the application in other scenarios, e.g. calling from a shortcut with the the w...

Launching external exe in MFC, how can I bring exe to front if already opened?

I have to open up a external program in my MFC application, which works but if I have already clicked button, I don't want it to open another instance but just bring it to front. The docs say the SW_SHOWNORMAL parameter does this, but it is not working for me. Does the called program have to setup for this also? ShellExecute(NULL, "op...

System-wide ShellExecute hooks?

Hello, is there any way I can install a system-wide ShellExecute hook using C++ without having to inject a hooking module into every active process. I am using Windows 7. My purpose for this is because, I want to be able to select which browser a link is opened in when a link is opened with the default browser using ShellExecute, like th...

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 Studio 9.0\VC\vcvarsall.bat"" x86 I would like to append the "tf changeset 12345" to it s...

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" profile instead of the user's. So for example, if the user at the keyboard has Firefox a...

starting a UAC elevated process from a non-interactive service (win32/.net/powershell)

I'm using a thrid party Windows service that handles some automation tasks by running scripts and executables using CreateProcessAsUser(). I'm running into problems on Windows Server 2008 due to UAC and way the LUA elevation is handled through the APIs. The service runs as LocalSystem and does not have "Interact With Desktop" enabled. T...

Chaining multiple ShellExecute calls

Consider the following code and its executable - runner.exe: #include <iostream> #include <string> #include <windows.h> using namespace std; int main(int argc, char *argv[]) { SHELLEXECUTEINFO shExecInfo; shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); shExecInfo.fMask = NULL; shExecInfo.hwnd = NULL; shExecInfo.lpV...

URL protocol handler shell execute problem

Hi, I'm working on a small hobby web site where I'm able to launch a local app with certain arguments based on links. Setting up a protocol wasn't difficult, as described in http://msdn.microsoft.com/en-us/library/aa767914(VS.85).aspx, but I have one dilemma: Let's say the protocol is: foo:127.0.0.1:1111, so a link like href="foo:127.0.0...

replace a particular text in all the files using single line shell command

i have a renamed js file which i have to call in each of my php page. Now i want to replace that old name with the new one using shell. what iam using is this :- sed -i ’s/old/new/g’ * but this is giving the following error :- sed: -e expression #1, char 1: unknown command: now how can i do this replacement?? ...

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? ...

shell_exec(),exec() on php is not working

i disabled safe_mode by off value and tried with shell_exec(),exec() both functions on 1and1 dedicated server its not working, even its working in another server. ...

Using Delphi's ShellExecute() with the process inheriting the original console?

In C I've used the system() function before in a console application and if I start another process using system() it inherits the console window of the process that called it. In Delphi system() doesn't exist so I'm using ShellExecute() to create a new process, but the new process comes up in a new console window. Is there some way th...

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&amp;ie=UTF-8&amp;q=handle.exe First, I need to run the executable file via ADMINISTRATOR permissions. This post has helped me achieve just that: http://stackoverflow.com/questions/667381/programatic...

is the code given in description is executable in Windows system?

is the code given is executable in Windows system? as it seems to be Linux commands echo 'create database foo2' | mysql -uroot mysqldump --skip-triggers -uroot foo | mysql -uroot foo2 EDITED I am executing the following code but I am not getting what I expect.. <?php mysql_connect('localhost','root','********'); echo 'c...

Cannot launch 16-bit application anymore

I'm trying to debug and resolve some issues with a Win32 macro application written C++ however I'm having the strangest issue. I have to launch a 16-bit program and then simulate entering data into and have been using ShellExecute for over two years now. I haven't touched this actual code at all, but now it doesn't work. I'm doing Shel...

how come we need not close the handle returned by ShellExecute ?

On success, ShellExecute returns a handle. Do we need to close this handle, and if so, how ? According to examples published my Microsoft, we need not close this handle. But the doc of ShellExecute itself is mute on the subject. Can you confirm we indeed do not need to close this handle ? But then, how can a handle be valid and in no...

How to open webpage in HIDDEN default browser? DELPHI

I have been trying to open a hidden default browser from delphi but coulnd't. I tried ShellExecute(self.WindowHandle,'open','www.google.com',nil,nil, SW_HIDE); and I get my chrome browser open but not hidden, and it opens a tab not a new window, also tried with TStartupInfo with the same results. Is there another way to achieve this?...

Launching an external application from within a NPAPI Plugin

I am trying to work out why an NPAPI plugin I have written, which works fine in terms of performing operations triggered via Javascipt calls, cannot use CreateProcess() or ShellExecute() to launch an application from a path specified via the Javascript call. I can seemingly use either of these methods and they return success, i.e. no e...