Jump to content

sendkeys shows after converting to exe telnet 192.168.1.1 -f 9.txt 'telnet' is not recognized as an internal or external command


Recommended Posts

i have converted a .au3 file to exe and i have a 64 bit windows when i chose compile for 64 bit system it works normally but when i un check  the  64 bit box .. it says telnet 192.168.1.1 -f 9.txt 'telnet' is not recognized as an internal or external command...

can i compile the .au3 to support 64 & 32 bit ...

 

errrror.PNG

Edited by minamon
improved it
Link to comment
Share on other sites

Try something like:

_RunCommand(@ComSpec & " /c telnet 192.168.1.1 -f 9.txt")

Func _RunCommand($_sCmdLine)
    If @OSArch = "x64" Then
        DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 1) ;~ Turns Off 64 Bit Redirection
            Run($_sCmdLine, "", @SW_HIDE)
        DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 0) ;~ Turns Off 64 Bit Redirection
    Else
        Run($_sCmdLine, "", @SW_HIDE)
    EndIf
EndFunc

 

Edited by Subz
Link to comment
Share on other sites

here what i mean 

Run('cmd',"",@SW_HIDE)
Local $hWnd = WinWait("[CLASS:cmd]", "", 1)
ControlSend("C:\WINDOWS\SYSTEM32\cmd.exe","","","attrib {+}H {+}S   log.txt{ENTER}")

ControlSend("C:\WINDOWS\SYSTEM32\cmd.exe","","","telnet 192.168.1.1 -f 10.txt{ENTER}")

Sleep (2000)
ControlSend("Telnet 192.168.1.1","","","admin{ENTER}")
ControlSend("Telnet 192.168.1.1","","","rtwlan rtdisp{ENTER}")
Sleep (1350)
WinClose("Telnet 192.168.1.1")
Run('cmd',"",@SW_HIDE)
Local $hWnd = WinWait("[CLASS:cmd]", "", 1)
ControlSend("C:\WINDOWS\SYSTEM32\cmd.exe","","","cd folder{ENTER}")
ControlSend("C:\WINDOWS\SYSTEM32\cmd.exe","","","attrib {-}H {-}S 10.txt{ENTER}")

where can i add those in your code ...

i am new here ..  sorry for any mistake 

Edited by minamon
Link to comment
Share on other sites

Sorry having late dinner, bit confused, where are the Log.txt and 10.txt files suppose to be located?  If you can let me know that, I'll update the code as I'm a little confused as what the attribs are trying to achieve.

Link to comment
Share on other sites

7 hours ago, minamon said:

'telnet' is not recognized as an internal or external command...

This is an error message from Windows 10 trying to tell you that the (telnet) program cannot be loaded and run or it is not installed!

By default Windows 10 does not install the telnet client.

A quick check in the Win10 : Control Panels - Windows Features - "Turn windows features on or off" will prove it.

 

Link to comment
Share on other sites

@PACaleala  As the OP stated Telnet works if you run (compiled as 64 bit on a 64 bit system) but not when the script is compiled as 32 bit.  By using Wow64DisableWow64FsRedirection within 32 bit script you can run a 64 bit executable without having to compile as 64 bit.  For example if you have Telnet installed then use the following code without compiling as 64 bit you will get the error that Telnet is not recognized as an internal or external command.

Run(@ComSpec & " /k " & $sTelnetHost & " -f %Temp%\9.txt")

If you use the following code also without compiling as 64 bit you will be successful

DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 1) ;~ Turns Off 64 Bit Redirection
    Run(@ComSpec & " /k " & $sTelnetHost & " -f %Temp%\9.txt")
DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 0) ;~ Turns Off 64 Bit Redirection

Hope that makes sense.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...