createprocess

Error while using command prompt or shell using process_create/3 in SWI Prolog

只谈情不闲聊 提交于 2019-12-12 19:05:53
问题 On Windows 7, when I used process_create/3 in SWI Prolog to open an application like Notepad.exe, the notepad opens. However, it doesn't work for applications that use command prompt. As an example, when I tried to open the command prompt window, using: main :- process_create('C:\\WINDOWS\\system32\\cmd.exe',[] ,[]). which gives an ERROR: Process "c:\windows\system32\cmd.exe": exit status: 1 Similarly, when trying it to open powershell.exe, it doesn't work either. the console just hangs,

How to get CreateProcess/CreateProcessW to execute a process in a path > MAX_PATH characters

随声附和 提交于 2019-12-12 16:18:27
问题 I'm trying to get either CreateProcess or CreateProcessW to execute a process with a name < MAX_PATH characters but in a path that's greater than MAX_PATH characters. According to the docs at: http://msdn.microsoft.com/en-us/library/ms682425.aspx, I need to make sure lpApplicationName isn't NULL and then lpCommandLine can be up to 32,768 characters. I tried that, but I get ERROR_PATH_NOT_FOUND. I changed to CreateProcessW, but still get the same error. When I prefix lpApplicationName with \\?

How can I create a process in a portable manner?

自古美人都是妖i 提交于 2019-12-12 10:04:03
问题 I'm trying to write a program which needs to create some other processes. I'm used to the Windows API but now I need my program to be able to run in a Linux platform too. Is it possible to do it in a portable manner? Do I have to use the preprocessor for that purpose? EDIT: I need to wait for it to finish before continuing to do things. 回答1: In my opinion the system function should always be avoided: it's unreliable, since you don't know what shell will handle your command and it doesn't have

google calendar event insert .NET c#

老子叫甜甜 提交于 2019-12-12 05:20:09
问题 When I execute the following code: public static Event createDashyboardCalendarEvent() { static string[] Scopes = { CalendarService.Scope.CalendarReadonly }; static string ApplicationName = "Outlook Google Syncher"; Event createdEvent = null; try { UserCredential credential; using (var stream = new FileStream( "client_secret.json", FileMode.Open, FileAccess.Read )) { string credPath = System.Environment.GetFolderPath( System.Environment.SpecialFolder.Personal ); credPath = Path.Combine(

Macro excel to create new sheets with names based on a list BUT if repeated do not create

元气小坏坏 提交于 2019-12-12 02:32:29
问题 I am able to create sheets including its name based on a selected list of "names" with the following code (below), BUT when there are cells with repeated name it will create a sheet without a name and the generic "sheet##". I want that if the cell name is repeated or there is a sheet already with that name (same thing) NOT to create a new sheet. Sub AddSheets() Dim cell As Excel.Range Dim wbToAddSheetsTo As Excel.Workbook Set wbToAddSheetsTo = ActiveWorkbook For Each cell In Selection With

ffmpeg from chrome native messaging host app not working

两盒软妹~` 提交于 2019-12-12 01:43:59
问题 OK, this is what I got, I'm using native messaging to fire a c++ program from a chrome extension in Windows. This c++ program (ehost.exe) creates a ffmpeg process for recording the input audio and saving it to mp3. I do this with the CreateProcess() function This works perfect when I open ehost.exe myself (double clicking it) but when I open it from my chrome extension ( chrome.runtime.connectNative() ), the ffmpeg process opens but ffmpeg writes no output file, as if it didn't have

How to call function CreateProcess in Delphi Prism?

为君一笑 提交于 2019-12-12 01:29:53
问题 I wrote function CreateProcess( lpApplicationName:String; lpCommandLine:String; lpProcessAttributes:IntPtr; lpThreadAttributes:IntPtr; bInheritHandles:Boolean; dwCreationFlags:Int32; lpEnvironment:IntPtr; lpCurrentDirectory:IntPtr; lpStartupInfo:STARTUPINFO; lpProcessInformation:ProcessInfo):Boolean; external 'kernel32.dll'; but VStudio said "Semicolon" expected - after external and " "end" expected" after 'kernel32.dll'; Can you help me to load and call a function please? 回答1: Why don't you

I am not able to kill a child process using TerminateProcess

我的未来我决定 提交于 2019-12-11 20:20:45
问题 I have a problem to kill a child process using TerminateProcess . I call to this function and the process still there (in the Task Manager). This piece of code is called many times launching the same program.exe many times and these process are there in the task manager which i think is not good. Actually is created two process all the time: the program.exe and conhost.exe. I will really appreciate any help. Here is the code: STARTUPINFO childProcStartupInfo; memset( &childProcStartupInfo, 0,

Print Pdf from windows service and keep working after logoff

对着背影说爱祢 提交于 2019-12-11 17:37:16
问题 I am creating a windows service that will print pdf in time interval. I have done some research on this and found a class public class ProcessStarter : IDisposable { #region Import Section private static uint STANDARD_RIGHTS_REQUIRED = 0x000F0000; private static uint STANDARD_RIGHTS_READ = 0x00020000; private static uint TOKEN_ASSIGN_PRIMARY = 0x0001; private static uint TOKEN_DUPLICATE = 0x0002; private static uint TOKEN_IMPERSONATE = 0x0004; private static uint TOKEN_QUERY = 0x0008; private

Do I need to close handles to standard I/O after CreateProcess?

情到浓时终转凉″ 提交于 2019-12-11 09:55:37
问题 I use the following STARTUPINFO structure in my call to CreateProcess . Do I need to call CloseHandle on hStdError and hStdInput after the process ends? startupInfo.cb = sizeof(startupInfo); startupInfo.cb = sizeof(si); startupInfo.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; startupInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE); startupInfo.hStdOutput = NULL; startupInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE); startupInfo.wShowWindow = SW_HIDE; 回答1: Since you didn't open those