PleaseHelpMEIWillLoveyou Posted July 4, 2018 Posted July 4, 2018 Is there a way to use a custom terminal or something from my pc and run a script on another pc. please let me know if its possible (not for anything bad just for a project im working on)
Moderators JLogan3o13 Posted July 5, 2018 Moderators Posted July 5, 2018 The easiest option is PSExec. Be aware, if you're doing something that relies on Send or MouseClick, or a GUI, you are going to have a difficult time of it. PleaseHelpMEIWillLoveyou 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
PleaseHelpMEIWillLoveyou Posted July 5, 2018 Author Posted July 5, 2018 (edited) 1 hour ago, JLogan3o13 said: The easiest option is PSExec. Be aware, if you're doing something that relies on Send or MouseClick, or a GUI, you are going to have a difficult time of it. thanks man but I was think of sending requests from a server and then when the script gets the request it runs the rest of the script. don't know how to explain it but I think it could be done never played with this kinda stuff pretty solid programmer tho anyways thanks again. Edited July 5, 2018 by PleaseHelpMEIWillLoveyou
Juvigy Posted July 5, 2018 Posted July 5, 2018 You can request data, or text files from the server and run the result. OR a simple scenario is for example PC1 has a shared folder with a txt file, the script on the server in the middle of the script downloads it and runs it. PC2 has another script - the script on the server in the middle of the script downloads it and runs it. Something like that.
jdelaney Posted July 5, 2018 Posted July 5, 2018 Tcpip messages between the computers. requires that you have some sort of listening script. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
PleaseHelpMEIWillLoveyou Posted July 7, 2018 Author Posted July 7, 2018 On 7/5/2018 at 2:30 PM, jdelaney said: Tcpip messages between the computers. requires that you have some sort of listening script. Thats I was thinking of but don't know how to do it can you help me? Thank you
PleaseHelpMEIWillLoveyou Posted July 7, 2018 Author Posted July 7, 2018 On 7/5/2018 at 2:08 AM, Juvigy said: You can request data, or text files from the server and run the result. OR a simple scenario is for example PC1 has a shared folder with a txt file, the script on the server in the middle of the script downloads it and runs it. PC2 has another script - the script on the server in the middle of the script downloads it and runs it. Something like that. yea man, do you have a clue how to do this or something will be greatly appreciated.
KickStarter15 Posted July 7, 2018 Posted July 7, 2018 (edited) Maybe if you will use the send and received method that can solve your problem. Let's say something like sending a txt file on a shared folder as what Juvigy said. How? 1. PC1, create a script that will send a text file on that specific shared folder with 0mb. 2. PC2, create a script that will loop to that shared folder looking for the specific text file using FileFindFirstFile() and FileFindNextFile(). 3. Once the script in PC2 find the specific text file, then it will run and you should directly delete the text file before the whole script run (else it will loop back many times). Or, I suggest search for chat script in this forum and you will see what I mean. Chat script has the same scenario as I stated above. Here's a sample script where you can start with. PC1 script: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> HotKeySet("{ESC}", "Terminate") #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("PC1", 150, 80, 300, 200) $Button1 = GUICtrlCreateButton("Send", 16, 20, 81, 33) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $logPath = "\\10.0.0.0\Shared\Test\" $info = MsgBox(4, "Sending Command in PC2", "This is just a confirmation!") If $info = 6 Then $hFile = FileOpen($logPath & "Test.log", 1) FileWriteLine($hFile, "") FileClose($hFile) Exit Else Exit EndIf EndSwitch WEnd PC2 script: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUISetState(@SW_HIDE) ; this will hide the process... While 1 Sleep(1000) Example() WEnd Func _RemoveFileExt($string) Return StringLeft($string,StringInStr($string,".",Default,-1)-1) EndFunc Func Example() $LogPath = "\\10.0.0.0\Shared\Test\*" ; this is you shared folder Local $hSearch = FileFindFirstFile($LogPath) $sFileName = FileFindNextFile($hSearch) If FileExists($LogPath & ".log") Then FileDelete("\\10.0.0.0\Shared\Test\" & $sFileName) $Form2 = GUICreate("PC2", 160, 100, 200, 124) $Button1 = GUICtrlCreateButton("Click Me", 16, 20, 81, 33) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button1 MsgBox(0,"",$sFileName) EndSwitch WEnd EndIf EndFunc If that's what you want. Edited July 7, 2018 by KickStarter15 Added sample code. PleaseHelpMEIWillLoveyou 1 Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare.
jdelaney Posted July 9, 2018 Posted July 9, 2018 For the TCP route, check the help file for: TCPConnect TCPListen TCPSend IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
PleaseHelpMEIWillLoveyou Posted July 10, 2018 Author Posted July 10, 2018 On 7/7/2018 at 12:12 AM, KickStarter15 said: Maybe if you will use the send and received method that can solve your problem. Let's say something like sending a txt file on a shared folder as what Juvigy said. How? 1. PC1, create a script that will send a text file on that specific shared folder with 0mb. 2. PC2, create a script that will loop to that shared folder looking for the specific text file using FileFindFirstFile() and FileFindNextFile(). 3. Once the script in PC2 find the specific text file, then it will run and you should directly delete the text file before the whole script run (else it will loop back many times). Or, I suggest search for chat script in this forum and you will see what I mean. Chat script has the same scenario as I stated above. Here's a sample script where you can start with. PC1 script: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> HotKeySet("{ESC}", "Terminate") #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("PC1", 150, 80, 300, 200) $Button1 = GUICtrlCreateButton("Send", 16, 20, 81, 33) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $logPath = "\\10.0.0.0\Shared\Test\" $info = MsgBox(4, "Sending Command in PC2", "This is just a confirmation!") If $info = 6 Then $hFile = FileOpen($logPath & "Test.log", 1) FileWriteLine($hFile, "") FileClose($hFile) Exit Else Exit EndIf EndSwitch WEnd PC2 script: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUISetState(@SW_HIDE) ; this will hide the process... While 1 Sleep(1000) Example() WEnd Func _RemoveFileExt($string) Return StringLeft($string,StringInStr($string,".",Default,-1)-1) EndFunc Func Example() $LogPath = "\\10.0.0.0\Shared\Test\*" ; this is you shared folder Local $hSearch = FileFindFirstFile($LogPath) $sFileName = FileFindNextFile($hSearch) If FileExists($LogPath & ".log") Then FileDelete("\\10.0.0.0\Shared\Test\" & $sFileName) $Form2 = GUICreate("PC2", 160, 100, 200, 124) $Button1 = GUICtrlCreateButton("Click Me", 16, 20, 81, 33) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button1 MsgBox(0,"",$sFileName) EndSwitch WEnd EndIf EndFunc If that's what you want. Thank you soo much Man Your the best!
PleaseHelpMEIWillLoveyou Posted July 10, 2018 Author Posted July 10, 2018 22 hours ago, jdelaney said: For the TCP route, check the help file for: TCPConnect TCPListen TCPSend Thanks man
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