RunSilent Action Plugin

Plugins y todo lo relacionado para Autoplay Media Studio.
danke gut
Gracias
tks very much!!
ok, estupendo!
enlace actualizado:

HIDE: ON
Hidebb Message Hidden Description
gracias

Thank you

Gracias

Pabloko escribió:Bueno, resulta que he convertido un viejo proyecto en el que usaba este action, como no tenia ganas de buscar una alternativa he escrito este plugin en 5 minutos para ejecutar exes de linea de comandos y toda esa mierda.

Aqui os dejo el trozo de codigo de la funcion...

static int irrunsilent_exec (lua_State *L)
{
int nLastError = 0;
IRLUA_PLUGIN_ResetLastError(L);
CString fromClipboard;
const char* strFunct;
const char* strstrParams;
IRLUA_PLUGIN_CheckNumArgs(L,2);
strFunct=IRLUA_PLUGIN_CheckString(L,1);
strstrParams=IRLUA_PLUGIN_CheckString(L,2);
STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInfo;
char Args[4096];
char *pEnvCMD = NULL;
char *pDefaultCMD = "CMD.EXE";
ULONG rc;
memset(&StartupInfo, 0, sizeof(StartupInfo));
StartupInfo.cb = sizeof(STARTUPINFO);
StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow = SW_HIDE;
Args[0] = 0;
pEnvCMD = getenv("COMSPEC");

if(pEnvCMD){

strcpy(Args, pEnvCMD);
}
else{
strcpy(Args, pDefaultCMD);
}
strcat(Args, " /c ");
strcat(Args, strFunct);
strcat(Args, " ");
strcat(Args, strstrParams);
if (!CreateProcess( NULL, Args, NULL, NULL, FALSE,
CREATE_NEW_CONSOLE,
NULL,
NULL,
&StartupInfo,
&ProcessInfo))
{
return GetLastError();
}
WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
if(!GetExitCodeProcess(ProcessInfo.hProcess, &rc))
rc = 0;
CloseHandle(ProcessInfo.hThread);
CloseHandle(ProcessInfo.hProcess);
return 1;
}


Descarga
HIDE: ON
Hidebb Message Hidden Description


enlace actualizado:

HIDE: ON
Hidebb Message Hidden Description


Ejemplo de uso

RunSilent.Exec("NetStat.exe",">> C:\\RunSilent.txt");
RunSilent.Exec("IpConfig.exe",">> C:\\RunSilent.txt");

Los resultados se van añadiendo al archivo c/runsilent.txt

gracias

thanks

:pc: :pc: :pc: :pc:

thanks

Could be what I'm looking for, thanks for posting. ;)

:friends:

Gracias

thankful

Me pondré a la tarea de sacarle el mayor provecho, gracias ;)

thanks..

\Mi proyecto.iso