It is possible, ask stack overflow
I've recently "fixed" my own script in Visualworks so as to use these low level API (already procided by VW)
���������� BOOL CreateProcessW(
������ ������ ������ ������ ������ LPCWSTR imageName,
������ ������ ������ ������ ������ LPCWSTR commandLine,
������ ������ ������ ������ ������ struct SECURITY_ATTRIBUTES *pSecurity,
������ ������ ������ ������ ������ struct SECURITY_ATTRIBUTES *tSecurity,
������ ������ ������ ������ ������ BOOL inheritHandles,
������ ������ ������ ������ ������ DWORD creationFlags,
������ ������ ������ ������ ������ LPVOID environment,
������ ������ ������ ������ ������ LPWSTR currentDirectoryName,
������ ������ ������ ������ ������ struct STARTUPINFO *startupInfo,
������ ������ ������ ������ ������ struct PROCESS_INFORMATION *processInfo)
First argument is fullpath to cmd.exe (take it from environment variable 'ComSpec')
Second argument is '/u /c ' ,�� 'your command here encoded in utf16'
Security arguments are nil and nil
inheritHandles is true
creationFlags is zero
environment is nil
currentDirectoryName is nil
startupInfo is more involved: it must be used to pass the pair of pipes (handles) for input/output:
struct STARTUPINFO {
������ ������ ������ DWORD������ cb;
������ ������ ������ LPTSTR������ ������ lpReserved;
������ ������ ������ LPTSTR������ ������ lpDesktop;
������ ������ ������ LPTSTR������ ������ lpTitle;
������ ������ ������ DWORD������ ������ dwX;
������ ������ ������ DWORD������ ������ dwY;
������ ������ ������ DWORD������ ������ dwXSize;
������ ������ ������ DWORD������ ������ dwYSize;
������ ������ ������ DWORD������ ������ dwXCountChars;
������ ������ ������ DWORD������ ������ dwYCountChars;
������ ������ ������ DWORD������ ������ dwFillAttribute;
������ ������ ������ DWORD������ ������ dwFlags;
������ ������ ������ WORD������ ������ wShowWindow;
������ ������ ������ WORD������ ������ cbReserved2;
������ ������ ������ LPBYTE������ ������ lpReserved2;
������ ������ ������ HANDLE������ hStdInput;
������ ������ ������ HANDLE������ hStdOutput;
������ ������ ������ HANDLE������ hStdError;
}
You initialize it with void GetStartupInfoW(LPSTARTUPINFO lpStartupInfo)
IMPORTANT: set
wShowWindow to 0,
and then pass the input/output/error handles in last three fields.
processInfo will contain information on output and must be allocated
struct PROCESS_INFORMATION {
������ ������ ������ HANDLE hProcess;
������ ������ ������ HANDLE hThread;
������ ������ ������ DWORD dwProcessId;
������ ������ ������ DWORD dwThreadId;
������ ������ }
you can then get exit status thru BOOL GetExitCodeProcess call, close the pipes, etc...