como Ejecutar un commando dos?? sin Run o !
Hola a Todos y gracias por ayudarme, la verdad es tengo una aplicacion q gurada la fecha y hora de las operaciones en una red local y quiero sincronizar la fecha con el servidor. en modo dos lo hago de la siguiente manera:
net time \servidor /set /yes
el problema es que si lo ejecuto desde mi apliacion me sale la odiosa pantallita del dos.
Alguien conose otra forma de hacerlo ? usando alguna libreria.
dese ya muchas gracias.
net time \servidor /set /yes
el problema es que si lo ejecuto desde mi apliacion me sale la odiosa pantallita del dos.
Alguien conose otra forma de hacerlo ? usando alguna libreria.
dese ya muchas gracias.
Saludos,
***************************************************************************
*!* -
*!* WinApi :: ShellExecute
*!* Function: Opens a file in the application that it\'s
*!* associated with.
*!* Pass: lcFileName - Name of the file to open
*!*
*!* Return: 2 - Bad Association (e.g., invalid URL)
*!* 31 - No application association
*!* 29 - Failure to load application
*!* 30 - Application is busy
*!*
*!* Values over 32 indicate success and return an instance handle for
*!* the application started (the browser)
*!* -
FUNCTION ShellExecute
LPARAMETERS tcFileName,tcWorkDir,tcOperation, tcParameter
LOCAL lcFileName,lcWorkDir,lcOperation,lcParameter
LOCAL idValor
IF EMPTY(tcFileName)
RETURN -1
ENDIF
lcFileName = ALLTRIM(tcFileName)
lcWorkDir = IIF(TYPE("tcWorkDir")="C",ALLTRIM(tcWorkDir),"")
lcOperation = IIF(TYPE("tcOperation")="C" AND NOT EMPTY(tcOperation),ALLTRIM(tcOperation),"Open")
lcParameter = IIF(TYPE("tcParameter")="C" AND NOT EMPTY(tcParameter),ALLTRIM(tcParameter),"")
*!* HINSTANCE ShellExecute(hwnd, lpszOp, lpszFile, lpszParams, lpszDir, wShowCmd)
*!*
*!* HWND hwnd - handle of parent window
*!* LPCTSTR lpszOp - address of string for operation to perform
*!* LPCTSTR lpszFile - address of string for filename
*!* LPTSTR lpszParams - address of string for executable-file parameters
*!* LPCTSTR lpszDir - address of string for default directory
*!* INT wShowCmd - whether file is shown when opened
DECLARE INTEGER ShellExecute ;
IN SHELL32.DLL ;
INTEGER nWinHandle,;
STRING cOperation,;
STRING cFileName,;
STRING cParameters,;
STRING cDirectory,;
INTEGER nShowWindow
idValor = ShellExecute(0,lcOperation,lcFilename,lcParameter,lcWorkDir,1)
*!* Desregistra el DLL, para liberar memoria
CLEAR DLLS
RETURN idValor
Atentamente,
Ken Torrealba
El Callao - Venezuela
***************************************************************************
*!* -
*!* WinApi :: ShellExecute
*!* Function: Opens a file in the application that it\'s
*!* associated with.
*!* Pass: lcFileName - Name of the file to open
*!*
*!* Return: 2 - Bad Association (e.g., invalid URL)
*!* 31 - No application association
*!* 29 - Failure to load application
*!* 30 - Application is busy
*!*
*!* Values over 32 indicate success and return an instance handle for
*!* the application started (the browser)
*!* -
FUNCTION ShellExecute
LPARAMETERS tcFileName,tcWorkDir,tcOperation, tcParameter
LOCAL lcFileName,lcWorkDir,lcOperation,lcParameter
LOCAL idValor
IF EMPTY(tcFileName)
RETURN -1
ENDIF
lcFileName = ALLTRIM(tcFileName)
lcWorkDir = IIF(TYPE("tcWorkDir")="C",ALLTRIM(tcWorkDir),"")
lcOperation = IIF(TYPE("tcOperation")="C" AND NOT EMPTY(tcOperation),ALLTRIM(tcOperation),"Open")
lcParameter = IIF(TYPE("tcParameter")="C" AND NOT EMPTY(tcParameter),ALLTRIM(tcParameter),"")
*!* HINSTANCE ShellExecute(hwnd, lpszOp, lpszFile, lpszParams, lpszDir, wShowCmd)
*!*
*!* HWND hwnd - handle of parent window
*!* LPCTSTR lpszOp - address of string for operation to perform
*!* LPCTSTR lpszFile - address of string for filename
*!* LPTSTR lpszParams - address of string for executable-file parameters
*!* LPCTSTR lpszDir - address of string for default directory
*!* INT wShowCmd - whether file is shown when opened
DECLARE INTEGER ShellExecute ;
IN SHELL32.DLL ;
INTEGER nWinHandle,;
STRING cOperation,;
STRING cFileName,;
STRING cParameters,;
STRING cDirectory,;
INTEGER nShowWindow
idValor = ShellExecute(0,lcOperation,lcFilename,lcParameter,lcWorkDir,1)
*!* Desregistra el DLL, para liberar memoria
CLEAR DLLS
RETURN idValor
Atentamente,
Ken Torrealba
El Callao - Venezuela
