shellexecute

Exec vs ExecWait vs ExecShell vs nsExec::Exec vs nsExec::ExecToLog vs nsExec::ExecToStack vs ExecDos vs ExeCmd

那年仲夏 提交于 2019-11-29 19:59:05
Can I know what are the differences between each Exec , ExecWait , ExecShell , nsExec::Exec , nsExec::ExecToLog, nsExec::ExecToStack , ExecDos and ExecCmd , as in when to use which? I 've posted the various execute calls I know. I am trying to make a comprehensive list, so that it helps future visitors.. Exec : Plainly execute the called string, be it some application, console or file. ExecWait : Executes like Exec but waits till the process exits. ExecShell : What is it for? nsExec::Exec : Just like Exec or ExecWait but only for command prompt and that too without opening the console window.

Is there anyway to specify a PrintTo printer when spawning a process?

你离开我真会死。 提交于 2019-11-29 18:24:07
问题 What I Have I am currently writing a program which takes a specified file and the performs some action with it. Currently it opens it, and/or attaches it to an email and mails it to specified addresses. The file can either be of the formats: Excel, Excel Report, Word, or PDF. What I am currently doing is spawning a process with the path of the file and then starting the process; however I also am trying to fix a bug feature that I added which adds the verb 'PrintTo' to the startup information

VBA: Running “Elevated” Command (Shell vs. ShellExecute)

半世苍凉 提交于 2019-11-29 15:29:45
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 and filename. After some experimenting, I think I need to run the command as if it were in an Elevated Command window (in other words, run it "as Administrator"). Is it possible to run Shell elevated? If that's not possible: If I understand correctly, using ShellExecute instead of Shell will automatically elevate the command. But I'm much less

ShellExecute fails if run from elevated process and non-default browser set in Windows 8 RTM

非 Y 不嫁゛ 提交于 2019-11-29 14:09:02
问题 Set non-default browser in Windows 8 RTM (Chrome, Firefox) and try to run code like this: ShellExecute(NULL, "open", "http://stackoverflow.com", NULL, NULL, SW_SHOWNORMAL); It's ok. But then change manifest to require Administrative priveleges or just "run as administrator". Code won't work. Ok, then try to run any application using "run as administrator". You will see the same result, links are not working. Change default browser back to IE -> all works fine. In Windows 8 previous builds

WindowsAPI - shellexecute

微笑、不失礼 提交于 2019-11-29 09:57:55
shellexecute(application.Handle,'open',PChar(runpath),nil,nil,SW_SHOWNORMAL); 比如我要打开c:\111.doc 你可以这样写 uses shellapi ShellExecute(handle, 'open','winword.exe', '111.doc', 'c:\', SW_SHOWNORMAL); ShellExecute(handle, 'open','winword.exe', 'c:\111.doc', nil, SW_SHOWNORMAL); 或者干脆 ShellExecute(handle, 'open','c:\111.doc', nil, nil, SW_SHOWNORMAL); 来源: CSDN 作者: iteye_12363 链接: https://blog.csdn.net/iteye_12363/article/details/81883955

How to call PHP file from a shell script file [duplicate]

孤者浪人 提交于 2019-11-29 08:24:47
This question already has an answer here: How to pass parameters from bash to php script? 3 answers I need a shell script which has a loop. In each loop iteration it needs to call a PHP file with some parameters. Is there any way to do it? In your php file named test.php, for example <?php //like programs in c language, use $argc, $argv access command line argument number and arguments, uncomment below two line to dump $argc and $argv //var_dump($argc); //an integer //var_dump($argv); //an array with arguments //use args and do anything you want echo "do my job\n"; exit(0); then create a shell

Executing another program from C#, do I need to parse the “command line” from registry myself?

假装没事ソ 提交于 2019-11-29 05:09:09
From the registry, for a given file type, I get a string containing something like this: "C:\Program Files\AppName\Executable.exe" /arg1 /arg2 /arg3 or sometimes: "C:\Program Files\AppName\Executable.exe" /arg1 /arg2 /arg3 "%1" In order for me to execute this program, and pass along a filename as a parameter (which I know it accepts), do I have to parse this string myself, or is there a runtime class that will do this for me? Note that I'm not asking about handling the difference between the two in regards to whether it has a "%1" or not, but rather I need to split off the name of the

Execute command line via php?

风流意气都作罢 提交于 2019-11-29 04:29:18
How I can execute those two command line via php: wkhtmltopdf www.google.com gg.pdf & oofice -headless -nologo -pt cup-pdf my.doc they both return a pdf file and download into my home directory. I want to know the way to execute those command from my html page via php. Thanks. You should take a look at the System program execution section of the manual : PHP provides several functions that can be used to launch external commands / programs, including : exec() -- which can store the output of the command in an array shell_exec() -- which returns, as a string, the output of the command system()

How can a Delphi Program send an Email with Attachments via the DEFAULT E-mail Client?

元气小坏坏 提交于 2019-11-28 21:26:44
问题 Within my program, I am composing an email to send using the default e-mail client software installed on a user's machine. I have composed the mailto address, the subject, the multilined body, and I have several attachments to be included. I almost got this working using mailto and ShellExecute as follows: Message := 'mailto:someone@somewhere.com' + '?subject=This is the subjectBehold Error Report' + '&body=This is line 1' + '%0D%0A' + 'This is line 2' + '%0D%0A' + 'This is line 3' + '&Attach

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

两盒软妹~` 提交于 2019-11-28 16:33:33
问题 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. The processes are being run as users in the Administrators group, but not the Administrator account (which is exempted from many UAC restrictions). All the UAC