Ver Mensaje Individual
  #1  
Antiguo 11-04-2013
wolfran_hack wolfran_hack is offline
Miembro
 
Registrado: abr 2013
Posts: 97
Reputación: 14
wolfran_hack Va por buen camino
Problema de compatibilidad de ShellExecute y WinExec

Se me ocurrió hace un acceso directo a telnet, en XP hago:

Código Delphi [-]
procedure TForm1.Label3Click(Sender: TObject);
begin
  // Conexión con Telnet:
  WinExec(PChar('telnet ' + Edit2.Text),SW_SHOWNORMAL);
end;

Funciona perfecto, en Windows 7 no, pruebo con:

Código Delphi [-]
procedure TForm1.Label2Click(Sender: TObject);
begin
  // Conexión con Telnet:
  ShellExecute(Handle, 'open', PChar('C:\Windows\System32\cmd.exe /c telnet 254.1.254.1'), nil, nil, SW_SHOWNORMAL);
  //Solo funciona en XP:
  //WinExec(PChar('telnet ' + Edit1.Text),SW_SHOWNORMAL);
end;

El PChar('C:\Windows\System32\cmd.exe'), funciona hasta ahí, luego no se abre nunca el terminal, cual puede ser el problema?
Responder Con Cita