winexec telnet

winexec telnet

Postby MarcoBoschi » Wed Sep 26, 2012 2: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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: winexec telnet

Postby ADutheil » Wed Sep 26, 2012 2: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
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: winexec telnet

Postby MarcoBoschi » Wed Sep 26, 2012 2:36 pm

P.S. is enabled!
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: winexec telnet

Postby Rick Lipkin » Wed Sep 26, 2012 2:44 pm

Marco

Try it this way and see what happens

Code: Select all  Expand view

 WaitRun( "Telnet",1 )  
 


Rick
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: winexec telnet

Postby MarcoBoschi » Wed Sep 26, 2012 2:52 pm

Rick,
nothing :evil:

If I copy telnet.exe in the same folder of program
IT RUNS
:roll:
bye
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: winexec telnet

Postby Rick Lipkin » Wed Sep 26, 2012 3:08 pm

Marco

Test this :

Code: Select all  Expand view

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: Select all  Expand view

WaitRun( GetWinDir()+"\system32\Telnet.exe",1 )
 


Rick
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: winexec telnet

Postby ADutheil » Wed Sep 26, 2012 3:23 pm

This works for me but it prompts for the user password.

Code: Select all  Expand view

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
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: winexec telnet

Postby MarcoBoschi » Wed Sep 26, 2012 3:31 pm

ok
many thanks
:D
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 40 guests