Score:0

Failed to run Batch file from application on Azure Stack HCI

bd flag

I am currently working on Azure Stack HCI. I have a C++ application running on it, and trying to run batch file from the application with processlauncher. The command line is like "cmd.exe /c xxx.bat".

 PROCESS_INFORMATION processInfo;
 ZeroMemory(&processInfo, sizeof(processInfo));
 BOOL createProcessReturnValue;
 IProcessLauncher& launcher = ProcessLauncher::GetInstance();
 STARTUPINFO startupInfo;
 ZeroMemory(&startupInfo, sizeof(startupInfo)); 
 startupInfo.dwFlags = STARTF_USESHOWWINDOW;
 startupInfo.wShowWindow = windowStyle;
 startupInfo.cb = sizeof(startupInfo);
 createProcessReturnValue = launcher.CreateProcess(NULL,
                        commandline.GetBuffer(),
                        NULL,
                        NULL,
                        FALSE,
                        NORMAL_PRIORITY_CLASS,
                        NULL,
                        currentDirectoryForProcess,
                        &startupInfo,
                        &processInfo);

From the logs, the command was executed, but nothing happened. Also not work if I open the cmd window via above code and run the command.

I tried the cmd from the command Window after pressing 15 on SConfig, or start a new task from task manager, it works without issue. I could not see any difference between these two command windows.

enter image description here

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.