FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour winexec telnet
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
winexec telnet
Posted: Wed Sep 26, 2012 02:31 PM

Why this program does not run telnet in windows 7
in XP it works fine

include "fivewin.ch"

FUNCTION MAIN()
winexec( "telnet" )
RETURN NIL

P.S. telnet is enabled

Marco Boschi
info@marcoboschi.it
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: winexec telnet
Posted: Wed Sep 26, 2012 02:32 PM

May be because telnet is not enabled by default in win 7. Can you run it from prompt?
Sorry I did not seen telnet is enabled.

Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: winexec telnet
Posted: Wed Sep 26, 2012 02:36 PM

P.S. is enabled!

Marco Boschi
info@marcoboschi.it
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: winexec telnet
Posted: Wed Sep 26, 2012 02:44 PM
Marco

Try it this way and see what happens

Code (fw): Select all Collapse
 WaitRun( "Telnet",1 )


Rick
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: winexec telnet
Posted: Wed Sep 26, 2012 02:52 PM

Rick,
nothing :evil:

If I copy telnet.exe in the same folder of program
IT RUNS

bye

:roll:

Marco Boschi
info@marcoboschi.it
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: winexec telnet
Posted: Wed Sep 26, 2012 03:08 PM
Marco

Test this :

Code (fw): Select all Collapse
WaitRun( "c:\windows\system32\Telnet.exe",1 )


If this works you can pull the "c:\windows" variable from the environment or this might work

Code (fw): Select all Collapse
WaitRun( GetWinDir()+"\system32\Telnet.exe",1 )


Rick
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: winexec telnet
Posted: Wed Sep 26, 2012 03:23 PM
This works for me but it prompts for the user password.

Code (fw): Select all Collapse
cStrg := "runas /noprofile /user:" + GetEnv( "COMPUTERNAME" ) + "\" + GetEnv( "USERNAME" ) + " TELNET"
winexec( cStrg )


@Rick: when you use winexec waitrun etc... it seems you loose elevated privileges. My login has administrator privileges for my computer. If i open a prompt with start button I can run telnet. If I open the prompt with waitrun or winexec telnet does not appear even with dir c:\windows\system32.
Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: winexec telnet
Posted: Wed Sep 26, 2012 03:31 PM

ok
many thanks

:D

Marco Boschi
info@marcoboschi.it

Continue the discussion