Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Is there a reason you are using chrome specifically? There is a whole UDF ready to go for internet explorer. Otherwise if you really need chrome I would suggest spending some time reading and understanding how to use this.
  3. Today
  4. For my next project I would like to send files with "alternate data streams" by email in ZIP format. I can not use any external program like 7-Zip or WinRAR. (They would fit๐Ÿ˜ฅ) Who knows how to create a ZIP file with "alternate data streams" included with the Powershell command "Compress-Archive"? Here a test script: (save as "ADSTester.cmd") @rem Try to create a zip file with alternate data streams (ADS) included @rem Housekeeping @cls @del ADSTester.zip >nul: @RD /S /Q Extracted >nul: @del ADSTester.txt >nul: @rem End of Housekeeping echo This is the ADSTester.txt file >ADSTester.txt echo This is the ADSTester.txt:Part1 file >ADSTester.txt:Part1 echo This is the ADSTester.txt:Part2 file >ADSTester.txt:Part2 dir /r ADSTester.txt @rem See the 3 files @rem **************************************************************** @rem **************************************************************** @rem Please alter the next lines to include the alternate data streams. powershell Compress-Archive -Path .\ADSTester.txt -Update -DestinationPath ADSTester.zip powershell Expand-Archive -Path ADSTester.zip -DestinationPath .\Extracted\ dir /r Extracted\ADSTester.txt @rem Only one file left :-( pause
  5. @Nine Unfortunately, that bit of code was given to me as I didn't write it. I wrote the primary script it calls at the end and all the batch files.
  6. I still do not understand the way the script is build. Do you understand it ? Because if the user is not an Admin, then the script should exit like I showed you. And how the end-user restarts both app and script when they stop working properly ?
  7. @Nine Yep only when the user first logs into windows, I've placed the script in the Windows startup folder to run once to run all those batch files.
  8. Hmmm. Well, I guess I'm not getting the full picture here. I suppose my first question would be... Does the PLC have the ability to manually change or stay static with port numbers? It looks like Wireshark is showing a local system port number, from it's communications stack. I don't think AutoIt UDP is the source of it. Your OS handles that locally. As long as your AutoIt script opens on the port of your choosing, it should be right. --edit-- Is there some way you can replicate your problem in a small reproducer script? --edit2-- If what you're trying to do is force change a socket number, that's not going to happen. The OS handles that automatically in the communications stack. As far as I know, there's no way to change it manually.
  9. 0xffffffffffffffff is indeed -1 but 18446744073709551615 is the max value of an (unsigned) uint64, beyond the max value of a (signed) int64 (-9223372036854775808 to 9223372036854775807).
  10. Something I do not understand with this above script : If RunAs($sAdminUser, $sDomain, $sAdminPassword, $iLogOnFlag, @AutoItExe & $sParameters) Then Exit Else Exit MsgBox(16 + 262144, "ERROR!", "Unable to run under administrator account.") EndIf and If ShellExecute(@AutoItExe, $sParameters, "", "runas") Then Exit Else Exit MsgBox(16 + 262144, "ERROR!", "Unable to elevate to Admin due to UAC.") EndIf Both will exit the script whether it is successful or not ! How this script is launched at user logon ?
  11. Hi CYCho, The pages do not require logging in. Do you know how to create an incognito session?
  12. OK, I have just been informed of some crucial information that I was unaware of before. This issue only occurs when the user first logins, which then points me to a different au3 script that must be the problem. As it is responsible for running a few batch files, then it will launch the 3rd party application and calls the script that I've been trying to troubleshoot. After 30 minutes the Case # window will not work. But, this is never a problem again, when the user closes both the 3rd party ap and script and reopens them again. Even with an hour break between it works still. All it does is run scripts with admin rights. So I'm not sure why it would cause this issue. The initial launch script is below: ;Elevate with the Admin account. **** DO NOT MODIFY THIS CODE BLOCK, IT IS FOR MAKING THE SCRIPT RUN AS ADMIN **** If @UserName <> $sAdminUser And Not IsAdmin() Then     $sParameters = ""     If Not @Compiled Then         $sParameters = ' "' & @ScriptFullPath & '"'     EndIf     If RunAs($sAdminUser, $sDomain, $sAdminPassword, $iLogOnFlag, @AutoItExe & $sParameters) Then         Exit     Else         Exit MsgBox(16 + 262144, "ERROR!", "Unable to run under administrator account.")     EndIf EndIf ;Run with Admin Token in Windows Vista and Higher.  **** DO NOT MODIFY THIS CODE BLOCK, IT IS FOR MAKING THE SCRIPT RUN AS ADMIN **** If @UserName = $sAdminUser And Not IsAdmin() And Not StringRegExp(@OSVersion, "_(XP|200(0|3))") Then     $sParameters = ""     If Not @Compiled Then         $sParameters = '"' & @ScriptFullPath & '"'     EndIf     If ShellExecute(@AutoItExe, $sParameters, "", "runas") Then         Exit     Else         Exit MsgBox(16 + 262144, "ERROR!", "Unable to elevate to Admin due to UAC.")    EndIf EndIf $fusionServerNameCmd = "cmd.exe /c sc queryex type= service state= all | find /i ""SERVICE_NAME: FUSION"" > fusionServiceName.txt" RunWait($fusionServerNameCmd, @ScriptDir) $cleanFusionFoldersCmd = "cmd.exe /c "& @ScriptDir & "\cleanFusionFolder.bat" RunWait($cleanFusionFoldersCmd, @ScriptDir) $setFusionFilesCmd = "cmd.exe /c "& @ScriptDir & "\setFusionFiles.bat" RunWait($setFusionFilesCmd, @ScriptDir) $setDefaultSound = "cmd.exe /c "& @ScriptDir & "\setDefaultSound.bat" RunWait($setDefaultSound, @ScriptDir) Run("C:\Program Files (x86)\Fusion Dictate\FusionDictate.exe") Do    Sleep(250) Until WinExists("Case #") ; Shell execute used to ensure shortcut.lnk works and is able to fetch its ini file ShellExecute("C:\gross\Gross shortcut.lnk")
  13. Yes, i try but it not working ๐Ÿ˜• I'm not fluent in this...
  14. Hello, thanks for your reply. I'm using Wireshark to do LAN traces. There I can see, that using UDPOpen() will correctly connect to the destination port specified, but will use an always randomly different SourcePort, it's going to send its data from. The socket Array does *NOT* hold the sending socket, that's going to be used when UDPopen() connects to some UDP Server. One correction: When I use in a Loop These three, UDPopen(), send one packet, UDPCloseSocket(), I can see, that one SourcePort Number after another is used up to the Limit of 64k (65534). So it's *NOT* a random high port, but the next in a continuously row from 48k to 64k. So it Looks like UDPOpen() respects a MinSocketNumber and a MaxSocketNumber. If I could adjust both values to 2051, I would end up exactly with what I need. (I know I will run into an error in case socket 2051 is "occupied" already) Then it jumps back to 48k (49152) and continues to go up by one again: cu, Rudi.
  15. Thank you very much for the help with this, ptrex! This helps a lot to get me started.
  16. Hello, I have a problem. I try to create autoit script: when page "www.test.com/qwertyuiop/" open in Google Chrome then wait 5 sec and close page Something like this will be good? Run('C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"') Sleep(5000) if ShellExecute("http://www.google.com") then sleep(5000) Send( "^w" )
  17. Maybe something like: Func CPU() Local $sCPU = Input("Location?", "Please Define Server Location?", "") If @error Then Return EndFunc Func MEMORY() Local $sMemory = Input("Location?", "Please Define Server Location?", "") If @error Then Return EndFunc Func STORAGE() Local $sStorage = Input("Location?", "Please Define Server Location?", "") If @error Then Return EndFunc Func Input($1 = "", $2 = "", $3 = "") $input = InputBox($1, $2, $3) If @error = 3 Then MsgBox("", "ERROR!", "ERROR: " & @error & " The InputBox Failed To Open! Please Exit & Re-Open Template Generator!") If @error = 4 Then MsgBox("", "FAILED!", "The InputBox Failed To Open! Please Exit & Re-Open Template Generator!") If Not @error = 1 Then Return SetError(0, 0, $input) Return SetError(1, 0, "") EndFunc ;==>Input
  18. Hello I want to return exitloop to cause my script to stop parsing data if the user cancels an inputbox *I have lots of these inputboxes so I want to just do an over all easy non repetitive @error check for all of the inputboxes where if the user cancels any inputbox it stops parsing pops up a messagebox that says "Template Generation Cancelled!" & continue running normally as if user hadn't pressed anything. *EDIT IS HERE: Is it as simple as returning ExitLoop 2 while wrapping the parsing in a While loop that increments $i at the end to cause it to exit after 1 parse? ex: Func CPU() While $i < 1 ;parse here etc... Input("Server Location?", "Please Define The Server Location:", "") $i += 1 Wend EndFunc Func Input($1, $2, $3) $input = Inputbox($1, $2, $3) If @error = 1 Then Return ExitLoop 2 EndFunc *END OF EDIT I have the following code: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Description=CNOC Template Generator #AutoIt3Wrapper_Res_Fileversion=1.0.0.8 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p #AutoIt3Wrapper_Res_ProductName=Automatic Template Generator #AutoIt3Wrapper_Res_ProductVersion=1.0.0.0 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <GuiStatusBar.au3> #Region ### START Koda GUI section ### Form= $Template_Generator = GUICreate("Template_Generator", 615, 480, 192, 124, BitOR($WS_THICKFRAME, $WS_VISIBLE)) $output = GUICtrlCreateEdit("", 24, 24, 569, 321, BitOR($GUI_SS_DEFAULT_EDIT, $ES_READONLY)) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) $generate = GUICtrlCreateButton("Generate Template", 105, 368, 113, 49) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) $copyTitle = GUICtrlCreateButton("Copy Title", 235, 368, 69, 22) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) $copyCI = GUICtrlCreateButton("Copy CI", 309, 368, 69, 22) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) $copyPID = GUICtrlCreateButton("Copy Event ID *NetCool*", 235, 395, 143, 22) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) $copyTemplate = GUICtrlCreateButton("Copy Template", 396, 368, 113, 49) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) $status = GUICtrlCreateInput(" Status: Program Loaded Successfully!", 0, 430, 615, 25) GUICtrlSetState(-1, 128) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $priority = "" $cID = "" $loc = "" $node = "" $title = "" $loc = "" $ip = "" $vCenter = "" $tool = "" $osType = "" $machineType = "" $pID = "" $incTitle = "" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $copyCI If StringInStr($node, "Volume:") Or StringInStr($node, "Virtual:") Or StringInStr($node, "Label:") Then ClipPut(StringReplace($node, StringRight($node, 4), "")) Else ClipPut($node) EndIf GUICtrlSetData($status, " Status: The CI Has Been Copied Successfully!") ;MsgBox("", "Output Copied!", "The Title Has" & @CRLF & " Been Copied Successfully!") Case $copyTitle ClipPut($incTitle) GUICtrlSetData($status, " Status: The Title Has Been Copied Successfully!") ;MsgBox("", "Output Copied!", "The Title Has" & @CRLF & " Been Copied Successfully!") Case $copyPID ClipPut($pID) GUICtrlSetData($status, " Status: The Event ID Has Been Copied Successfully!") ;MsgBox("", "Output Copied!", "The Event ID Has" & @CRLF & " Been Copied Successfully!") Case $copyTemplate ClipPut(GUICtrlRead($output)) GUICtrlSetData($status, " Status: The Output Has Been Copied Successfully!") ;MsgBox("", "Output Copied!", "The Output Has" & @CRLF & " Been Copied Successfully!") Case $generate GUICtrlSetData($output, "") Local $clip = ClipGet() $splitClip = StringSplit($clip, @CRLF) ;_ArrayDisplay($splitClip) If UBound($splitClip) > 3 Then If StringInStr($splitClip[3], "Message:") Then $title = StringStripWS(StringSplit($splitClip[3], "Message:", 1)[2], 3) ;MsgBox("", "", $title) If StringInStr($title, "CPU") Then CPU() ElseIf StringInStr($title, "Volume") Or StringInStr($title, "Virtual") Or StringInStr($title, "Label") Or StringInStr($title, "Datastore") Then STORAGE() ElseIf StringInStr($title, "Memory") Then MEMORY() EndIf Else MsgBox("", "No Data?", "Error! No Data Copied!") EndIf Else MsgBox("", "No Data?", "Error! No Data Copied!") EndIf EndSwitch WEnd Func CPU() ;Parse data here also accept user input as below: Input("Location?", "Please Define Server Location?", "") ;If Not Return ExitLoop continue parsing, otherwise stop parsing. EndFunc Func MEMORY() ;Parse data here also accept user input as below: Input("Location?", "Please Define Server Location?", "") ;If Not Return ExitLoop continue parsing, otherwise stop parsing. EndFunc Func STORAGE() ;Parse data here also accept user input as below: Input("Location?", "Please Define Server Location?", "") ;If Not Return ExitLoop continue parsing, otherwise stop parsing. EndFunc Func Input($1, $2, $3) If $1 = Default Then $1 = "" If $2 = Default Then $2 = "" If $3 = Default Then $3 = "" If $1 = "" Then $1 = "" If $2 = "" Then $2 = "" If $3 = "" Then $3 = "" $input = InputBox($1, $2, $3) If @error = 1 Then Return ExitLoop ; I want this If @error = 3 Then MsgBox("", "ERROR!", "ERROR: " & @error & " The InputBox Failed To Open! Please Exit & Re-Open Template Generator!") If @error = 4 Then MsgBox("", "FAILED!", "The InputBox Failed To Open! Please Exit & Re-Open Template Generator!") If Not @error = 1 Then Return $input EndFunc ;==>Input
  19. Hi everybody First of all, let me paste a part of LarsJ's explanation, found here, it could be related to the issue I'll expose below. I'm facing a problem with the following script because : * each right click on the header displays correctly a header context menu, with correct consolewrite info, even when you don't select any option in the menu : * each right click on a cell doesn't display the corresponding cell context menu : it appears at 1st right click, then if you don't select anything but right click a 2nd time, no menu appears (it would appear at 3rd click, not at 4th etc...) Here is the full script : #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <GuiMenu.au3> #include <WindowsConstants.au3> Global $g_hListView, $g_hHeader, $g_bHeaderMenu = False, $g_bCellMenu = False, $g_iCounter = 0 Example() ;============================================ Func Example() Local $hGUI = GUICreate("Right-click on headers or cells", 400, 200) Local $idListView = GUICtrlCreateListView _ (" Col 0 | Col 1| Col 2| Col 3", 10, 10, 380, 180) $g_hListView = GuiCtrlGetHandle($idListView) $g_hHeader = _GUICtrlListView_GetHeader($idListView) For $iRow = 0 To 9 GUICtrlCreateListViewItem( _ "Row " & $iRow & " / Col 0 |" & _ "Row " & $iRow & " / Col 1 |" & _ "Row " & $iRow & " / Col 2 |" & _ "Row " & $iRow & " / Col 3", $idListView) Next GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetState(@SW_SHOW) While 1 If $g_bHeaderMenu Then ; right click on header => Header context menu ConsoleWrite($g_iCounter & " HD Main A" & @lf) ConsoleWrite("============" & @lf) Header_menu() ConsoleWrite($g_iCounter & " HD Main B" & @lf) ; other code here $g_bHeaderMenu = False EndIf If $g_bCellMenu Then ; right click on any cell => Cell context menu ConsoleWrite($g_iCounter & " LV Main A" & @lf) ConsoleWrite("============" & @lf) Cell_menu() ConsoleWrite($g_iCounter & " LV Main B" & @lf) ; other code here $g_bCellMenu = False EndIf Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete($hGUI) Exit EndSwitch Wend EndFunc ;==>Example ;============================================ Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $tNMHDR, $hWndFrom, $iIDFrom, $iCode $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = DllStructGetData($tNMHDR, "hWndFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $g_hListView Switch $iCode Case $NM_RCLICK $g_bCellMenu = True $g_iCounter += 1 ConsoleWrite($g_iCounter & " LV Notify" & @lf) EndSwitch Case $g_hHeader Switch $iCode Case $NM_RCLICK $g_bHeaderMenu = True $g_iCounter += 1 ConsoleWrite($g_iCounter & " HD Notify" & @lf) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY ;============================================ Func Header_menu() ; called by right click on header Local $iMenu_Choice = 0 Local $hMenu = _GUICtrlMenu_CreatePopup() _GUICtrlMenu_InsertMenuItem($hMenu, 10, "Header menu", 10) _GUICtrlMenu_InsertMenuItem($hMenu, 15, "", 0) _GUICtrlMenu_InsertMenuItem($hMenu, 20, "Option 1", 20) _GUICtrlMenu_InsertMenuItem($hMenu, 30, "Option 2", 30) $iMenu_Choice = _GUICtrlMenu_TrackPopupMenu($hMenu, $g_hHeader, -1, -1, 1, 1, 2) _GUICtrlMenu_DestroyMenu($hMenu) Switch $iMenu_Choice Case 0, 10 Case 20 Case 30 EndSwitch EndFunc ;==>Header_menu ;============================================ Func Cell_menu() ; called by right click on any cell Local $iMenu_Choice = 0 Local $hMenu = _GUICtrlMenu_CreatePopup() _GUICtrlMenu_InsertMenuItem($hMenu, 10, "Cell menu", 10) _GUICtrlMenu_InsertMenuItem($hMenu, 15, "", 0) _GUICtrlMenu_InsertMenuItem($hMenu, 20, "Option 3", 20) _GUICtrlMenu_InsertMenuItem($hMenu, 30, "Option 4", 30) $iMenu_Choice = _GUICtrlMenu_TrackPopupMenu($hMenu, $g_hHeader, -1, -1, 1, 1, 2) _GUICtrlMenu_DestroyMenu($hMenu) Switch $iMenu_Choice Case 0, 10 Case 20 Case 30 EndSwitch EndFunc ;==>Cell_menu What I notice in the compared Console outputs is this : A ) In case of the header menu, the 2nd right click doesn't trigger immediately the WM_NOTIFY message. See this "yellowed" line in the pic ? 1 HD Main B It's the part of the main loop that follows the 1st Header_menu() and it's executed when you right-click for the 2nd time. Immediately after that are triggered : 2 HD Notify 2 HD Main A B ) In case of the cell menu, why don't we have the same line ? 1 LV Main B It's not here (and I don't know why), it seems that the 2nd right-click on a cell triggers immediately the WM_NOTIFY message, without ending first the main loop (as it does in case of header menu) So anyone could explain why these 2 situations are different ? Thanks
  20. Hi, Sorry to bring up this old topic but I fail to find a solution to my problem! Can this functions be used to read a reg_qword value that is set to ffffffffffffffff in hex and 18446744073709551615 in decimal? Its returning -1 for me!
  21. Unfortunately in a domain environment Win32_UserAccount (takes forever to resolve domain users) if your disconnected from the network it works fine or if you only require local users you can use that within the query. Local $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_UserAccount Where LocalAccount = True") Couple of days ago I needed to query a couple of hundred user accounts that had profiles on multiple RDS servers and used the following method to get the user accounts: #include <Array.au3> #include <Security.au3> Global $g_aProfileList[0] _UserProfiles(4) _ArrayDisplay($g_aProfileList) ;~ $_vDomain : 0 - All Users on the system ;~ : 1 = NT Authority Users on the system ;~ : 2 = Local Users on the system ;~ : 3 = NT Authority + Local Users on the system ;~ : 4 = Domain Users on the system ;~ : 5 = NT Authority + Domain Users on the system ;~ : 6 = Local + Domain Users on the system Func _UserProfiles($_vDomain = 0) Local $sRegProfileList = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" Local $aAccountSid, $sRegProfileGuid, $i = 1 While 1 $sRegProfileGuid = RegEnumKey($sRegProfileList, $i) If @error Then ExitLoop $aAccountSid = _Security__LookupAccountSid($sRegProfileGuid) If @error Then ContinueLoop If IsArray($aAccountSid) Then While 1 Switch $_vDomain Case 1 If ($aAccountSid[1] <> "NT Authority") Then ExitLoop Case 2 If ($aAccountSid[1] <> @ComputerName) Then ExitLoop Case 3 If Not ($aAccountSid[1] = "NT Authority" Or $aAccountSid[1] = @ComputerName) Then ExitLoop Case 4 If ($aAccountSid[1] = "NT Authority" Or $aAccountSid[1] = @ComputerName) Then ExitLoop Case 5 If $aAccountSid[1] = @ComputerName Then ExitLoop Case 6 If $aAccountSid[1] = "NT Authority" Then ExitLoop EndSwitch ReDim $g_aProfileList[UBound($g_aProfileList) + 1] $g_aProfileList[UBound($g_aProfileList) - 1] = $aAccountSid[0] ExitLoop WEnd EndIf $i += 1 WEnd EndFunc
  22. Just searched Google for "NextCloud Silent Install"
  23. For #1 it is very easy. Just create a GUI with a combo-box and use GUICtrlSetData ($idCombo, $Users) to store the values into the combo For #2, can you run this, see if you get all users this way (show the result if you can) : #include <Constants.au3> Global $objWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2") Local $Output = "Computer: " & @ComputerName & @CRLF $Output &= "==========================================" & @CRLF Local $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_UserAccount") If not IsObj($colItems) then Exit Msgbox(0,"WMI Output","No WMI Objects Found") For $objItem In $colItems $Output &= "Caption: " & $objItem.Caption & @CRLF Next MsgBox ($MB_SYSTEMMODAL,"",$Output)
  24. Hello Subz, thanks for your proposal. Yes this installs the Client, even removing the old versions from the system!! I only wonder, where did you find a reference to those parameters? Or did you simply derive them from MSI installers? Now I will continue to automate the settings for the user. Again thanks a lot! I hope I'm able to return some help into the forum at some point. PS: Sorry for the late answer. First i had a meeting and then i experimented a bit with your command line parameters.
  1. Load more activity
×
×
  • Create New...