minamon Posted June 9, 2018 Share Posted June 9, 2018 (edited) 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 ... Edited June 9, 2018 by minamon improved it Link to comment Share on other sites More sharing options...
Subz Posted June 9, 2018 Share Posted June 9, 2018 (edited) 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 June 9, 2018 by Subz minamon 1 Link to comment Share on other sites More sharing options...
minamon Posted June 9, 2018 Author Share Posted June 9, 2018 Where can I add the other lines of my code like . Send.control. And I run the file hidden Link to comment Share on other sites More sharing options...
Subz Posted June 9, 2018 Share Posted June 9, 2018 Can you explain further? This runs CMD with telnet command hidden, you can add other code after the command has been executed. Link to comment Share on other sites More sharing options...
minamon Posted June 9, 2018 Author Share Posted June 9, 2018 (edited) 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 June 9, 2018 by minamon Link to comment Share on other sites More sharing options...
Subz Posted June 9, 2018 Share Posted June 9, 2018 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 More sharing options...
PACaleala Posted June 9, 2018 Share Posted June 9, 2018 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 More sharing options...
Subz Posted June 9, 2018 Share Posted June 9, 2018 @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. minamon 1 Link to comment Share on other sites More sharing options...
minamon Posted June 9, 2018 Author Share Posted June 9, 2018 thanks bro it did the work perfectly.. i just added your line DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 1) to the start of my code and every thing worked perfectly Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now