Leaderboard
Popular Content
Showing content with the highest reputation on 01/11/2021 in all areas
-
Use AutoItX as COM ROT object, without regsvr32 registration
argumentum and one other reacted to ptrex for a topic
Thanks for the confirmation ! Good to hear all is working. This means as of now everyone can start doing DLLCall's from VBScripts in a Portable way ! 😄2 points -
More information doesn't always help making it better. Think that page is pretty clear as is as long as one knows what to look for an read it.1 point
-
Use AutoItX as COM ROT object, without regsvr32 registration
Professor_Bernd reacted to argumentum for a topic
threadingModel="Apartment" progid="DynamicWrapper"/> was missing from the manifest file. It now works.1 point -
Everything needed for normal operation is included with the installation. The help has example code for everything and the help examples should work as they are. Some users may have created their own UDFs and in order to run these specialised applications you may need to DL and install the unique UDFs. If you've tried something and it didn't work you probably did not insert the required includes in your code. What, specifically have you tried that does not work? Give examples.1 point
-
Copy txt files content into Final txt file
FrancescoDiMuro reacted to mikell for a topic
Of course, there is not enough time left for this ... try to use RunWait instead of Run and BTW mixing the numbers in the $tempX and $fileX variables makes the thing work less too RunWait(@ComSpec&' /c '&$sCommand&' '&$IP_Google1&' >> "'&$temp1&'"','',@SW_HIDE) $file1 = FileRead($temp1) FileWrite($sOutputFile,$file1) FileDelete($temp1) RunWait(@ComSpec&' /c '&$sCommand&' '&$IP_Google2&' >> "'&$temp2&'"','',@SW_HIDE) $file2 = FileRead($temp2) FileWrite($sOutputFile,$file2) FileDelete($temp2) RunWait(@ComSpec&' /c '&$sCommand&' '&$IP_Bing&' >> "'&$temp3&'"','',@SW_HIDE) $file3 = FileRead($temp3) FileWrite($sOutputFile,$file3) FileDelete($temp3) Edit BTW(2) a much more efficient way would be like this #include <GUIConstantsEx.au3> $Form1 = GUICreate("Automated UAT (Project Name )", 200, 200) Global $sOutputFile = @DesktopDir & "\" & @ComputerName & "_FinalOutput.txt" $Button = GUICtrlCreateButton("START", 50, 100, 100, 33) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button $IP_Google1 = "8.8.8.8" $IP_Google2 = "8.8.4.4" $sCommand='ping' Local $s = "" $iPID = Run(@ComSpec & ' /c ' & $sCommand & ' ' & $IP_Google1, "", @SW_HIDE, 2) ;$STDOUT_CHILD ProcessWaitClose($iPID) $s &= StdoutRead($iPID) $iPID = Run(@ComSpec & ' /c ' & $sCommand & ' ' & $IP_Google2, "", @SW_HIDE, 2) ProcessWaitClose($iPID) $s &= StdoutRead($iPID) FileWrite($sOutputFile, $s) EndSwitch WEnd1 point -
Copy txt files content into Final txt file
Musashi reacted to FrancescoDiMuro for a topic
@mikestern You need to open the file in WRITE mode, otherwise all the FileWrite() functions will fail. Adding a bit of debugging, you'll see what's going on there: #include <GUIConstantsEx.au3> #include <File.au3> #include <FileConstants.au3> $Form1 = GUICreate("Automated UAT (Project Name )", 200, 200) Global $sOutputFile = @DesktopDir & "\" & @ComputerName & "_FinalOutput.txt" Global $temp1 = @DesktopDir & "\" & "_G1.txt" Global $temp2 = @DesktopDir & "\" & "_G2.txt" Global $temp3 = @DesktopDir & "\" & "_G3.txt" $Button = GUICtrlCreateButton("START", 50, 100, 100, 33) Global $hOutputFile GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button $IP_Google1 = "8.8.8.8" $IP_Google2 = "8.8.4.4" $IP_Bing = "202.89.233.100" $sCommand='ping' Run(@ComSpec&' /c '&$sCommand&' '&$IP_Google1&' >> "'&$temp1&'"','',@SW_HIDE) $file1 = FileRead($temp1) ; Open the file in APPEND mode $hOutputFile = FileOpen($sOutputFile, $FO_APPEND) ConsoleWrite((FileWrite($hOutputFile,$file1) ? "FileWrite $file1 OK" : "FileWrite $file1 ERR") & @CRLF) FileDelete($temp1) Run(@ComSpec&' /c '&$sCommand&' '&$IP_Google2&' >> "'&$temp2&'"','',@SW_HIDE) $file2 = FileRead($temp2) ConsoleWrite((FileWrite($hOutputFile,$file1) ? "FileWrite $file2 OK" : "FileWrite $file2 ERR") & @CRLF) FileDelete($temp3) Run(@ComSpec&' /c '&$sCommand&' '&$IP_Bing&' >> "'&$temp3&'"','',@SW_HIDE) $file3 = FileRead($temp2) ConsoleWrite((FileWrite($hOutputFile,$file3) ? "FileWrite $file3 OK" : "FileWrite $file3 ERR") & @CRLF) FileDelete($temp3) ; Close the file previousely opened FileClose($hOutputFile) EndSwitch WEnd1 point -
I made a UDP broadcast between a client and server. If the server and client are on the same LAN this routine return the IP address from the server without knowing the name or ipaddress from the server. I'm a newbie on programming TCP/UDP and I think there are better ways to do this so I want to know what you think of this. Server #include <Array.au3> Global $server_name = "TRS" Global $send_port = 6666 Global $recieve_port = 7777 UDPStartup() Global $_Socket_Send_Local_IP = UDPBind(@IPAddress1, $send_port) While 1 _Loop_Send_Local_IP($server_name) WEnd Func _Loop_Send_Local_IP($server_name) $data = UDPRecv($_Socket_Send_Local_IP, 50, $UDP_DATA_ARRAY) If IsArray($data) Then If $data[0] <> "" Then If $data[0] = $server_name Then $socket_send = UDPOpen($data[1], $recieve_port) $status = UDPSend($socket_send, $server_name) UDPCloseSocket($socket_send) EndIf EndIf EndIf EndFunc UDPShutdown() Exit Client #include <Array.au3> Global $server_name = "TRS" Global $send_port = 6666 Global $recieve_port = 7777 UDPStartup() $sIPADDRESS = _Get_client_ip($server_name) ConsoleWrite("Ip address server is " & $sIPADDRESS & @CRLF) Func _Get_client_ip($sendstring) Local $data, $count, $count_total UDPStartup() Local $socket_send = UDPOpen("255.255.255.255", $send_port, 1); Multicast Local $socket_recieve = UDPBind(@IPAddress1, $recieve_port) If UDPSend($socket_send, $sendstring) = 0 then SetError(1); Else While 1 If $count_total > 20 Then SetError(2) ExitLoop EndIf If $count > 5 Then If UDPSend($socket_send, $sendstring) = 0 then SetError(1); ExitLoop EndIf $count = 0 EndIf $data = UDPRecv($socket_recieve, 50, $UDP_DATA_ARRAY) If IsArray($data) Then If $data[0] = $server_name Then ExitLoop EndIf EndIf $count = $count + 1 $count_total = $count_total + 1 Sleep(100) WEnd EndIf UDPCloseSocket($socket_send) UDPCloseSocket($socket_recieve) UDPShutdown() Return $data[1] EndFunc UDPShutdown() Exit1 point
-
Use AutoItX as COM ROT object, without regsvr32 registration
Professor_Bernd reacted to ptrex for a topic
Challenge asked for was : Have VBScript call Windows API's and make it Portable. This is how you can test it : 1. Put the dynwrap.dll in the folder c:\TEMP 2. Put this content in a file called dynwrap.sxs.manifest file in the same folder as the DynWrap.dll 3. Save this VBScript in the same folder as TEST.VBS 4. Run it script by dropping the VBScript on the wscript.exe x32 (in SysWOW64) shortcut TESTED and working on : Windows 10 / Server 2008 / Server 2019 Enjoy ! PS : Correction - File path in Manifest was wrong. - Corrected typo's again 😞 - Added test results different OS's dynwrap.zip1 point -
@Nyl- Just a small fix for the client. #include <Array.au3> Global $server_name = "TRS" Global $send_port = 6666 Global $recieve_port = 7777 UDPStartup() $sIPADDRESS = _Get_client_ip($server_name) If @error Then ConsoleWrite("Error" & @CRLF) Else ConsoleWrite("Ip address server is " & $sIPADDRESS & @CRLF) EndIf Func _Get_client_ip($sendstring) Local $data, $count, $count_total UDPStartup() Local $socket_send = UDPOpen("255.255.255.255", $send_port, 1); Multicast Local $socket_recieve = UDPBind(@IPAddress1, $recieve_port) If UDPSend($socket_send, $sendstring) = 0 then SetError(1) Else While 1 If $count_total > 20 Then SetError(2) ExitLoop EndIf If $count > 5 Then If UDPSend($socket_send, $sendstring) = 0 then SetError(1); ExitLoop EndIf $count = 0 EndIf $data = UDPRecv($socket_recieve, 50, $UDP_DATA_ARRAY) If IsArray($data) Then If $data[0] = $server_name Then ExitLoop EndIf EndIf $count = $count + 1 $count_total = $count_total + 1 Sleep(100) WEnd EndIf UDPCloseSocket($socket_send) UDPCloseSocket($socket_recieve) UDPShutdown() If UBound($data) = 0 Then Return SetError(2) Else Return $data[1] EndIf EndFunc UDPShutdown() Exit1 point
-
Hello and welcome to the forum. shortly: Yes, it does. There are multiple ways to reach it and you will need some routines to make it possible, because Google is very unique in their websites. so you could automate it with hotkeys in Google Docs & mouseclicks (dirty way) or webdriver e.g. regards1 point