-
Posts
1,495 -
Joined
-
Last visited
-
Days Won
1
caramen last won the day on October 28 2020
caramen had the most liked content!
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
caramen's Achievements
-
Help for multiple html tables. With random value.
caramen replied to caramen's topic in AutoIt General Help and Support
I will figure out, and reply. -
Help for multiple html tables. With random value.
caramen replied to caramen's topic in AutoIt General Help and Support
What would you do for the final file overview and how ? -
Help for multiple html tables. With random value.
caramen replied to caramen's topic in AutoIt General Help and Support
I did some test with regexp and python, but it becomes too complex for me after I have to implement random title inside my logic. -
Help for multiple html tables. With random value.
caramen replied to caramen's topic in AutoIt General Help and Support
All parts xD The purpose is to compare 1500 reports to analyze and delete useless GPO from 13 different domains. And this is why it's complicated. All reports will have different structures. But they are using almost same HTML or XML structures. I can provide more picture and / or samples of different report -
Hello peoples. Long time I did not fall into a complex problem. I come here to ask for help in the logic to solve a problem I don't have brain or skills to solve or maybe both I got 1500 reports coming from GPO-Backup. They are in HTML format, but can be in XML format as well. Actually, I'm working with the HTML format. My problem is the following : I need to format all these data, to be able to compare all reports in any easy way. The problem is each rapport have multiple table that contains multiple value sorted sometime in 5 columns and sometime in 10 columns, and they can have random amount of lines. As an example, this is some different tables that I can need to work with : <div class="gposummary"> <div class="he0_expanded"><span class="sectionTitle" tabindex="0">Général</span><a class="expando" href="#"></a></div> <div class="container"><div class="he1"><span class="sectionTitle" tabindex="0">Détails</span><a class="expando" href="#"></a></div> <div class="container"><div class="he4i"><table class="info" cellpadding="0" cellspacing="0"> <tr><td scope="row">Domaine</td><td>aXXXXXXXXXXr</td></tr> <tr><td scope="row">Propriétaire</td><td>AC\Admins du domaine</td></tr> <tr><td scope="row">Créé le</td><td>02/04/2014 19:19:24</td></tr> <tr><td scope="row">Modifié le</td><td>07/03/2022 17:44:04</td></tr> <tr><td scope="row">Révisions utilisateur</td><td>2 (AD), 2 (SYSVOL)</td></tr> <tr><td scope="row">Révisions ordinateur</td><td>0 (AD), 0 (SYSVOL)</td></tr> <tr><td scope="row">ID unique</td><td>{546eXXXXXXXXXXXXXXXXXXXf48}</td></tr> <tr><td scope="row">État GPO</td><td>Tous les paramètres désactivés</td></tr> </table></div></div> <div class="he0_expanded"><span class="sectionTitle" tabindex="0">Configuration utilisateur (désactivée)</span><a class="expando" href="#"></a></div> <div class="container"><div class="he1h_expanded"><span class="sectionTitle" tabindex="0">Stratégies</span><a class="expando" href="#"></a></div> <div class="container"><div class="he1_expanded"><span class="sectionTitle" tabindex="0">Paramètres Windows</span><a class="expando" href="#"></a></div> <div class="container"><div class="he2"><span class="sectionTitle" tabindex="0">Scripts</span><a class="expando" href="#"></a></div> <div class="container"><div class="he4"><span class="sectionTitle" tabindex="0">Ouvrir la session</span><a class="expando" href="#"></a></div> <div class="container"> <div class="he4i"><b>For this GPO, Script order:</b> Non configuré</div><div class="he4i"><table class="info" cellpadding="0" cellspacing="0"> <tr><th scope="col">Nom</th><th scope="col">Paramètres</th></tr> <tr><td>aXXXXXXXXX.bat</td><td></td></tr> </table> The goal would be to have a final view of all 1500 reports to compare them. Each time a new column name is meet, we make a new column name, and leave it empty if it does not exist in the next report. One line per report. I'm struggling with this since too much time now if anyone of you have a logic help for something like this I take ! 😭
-
This is a solution I get from this post : And I had this script from the topic : (Whitch helped me a lot in lot of similar situation.) It could react the same with your shell console. You have to redefine the code as you need. #include <constants.au3> #include <string.au3> #RequireAdmin ; Use RunAs if you want use a fixed username/password within the script: ; Global $hPowerShellPID = RunAs("UserName", "Domain", "Password", "", "powershell.exe", '', @SW_HIDE, BitOR($STDIN_CHILD, $STDERR_MERGED)) ; or use #RequireAdmin and a simple Run Statement to enter Admin credentials (if needed) at runtime ; Here we start a "permanent" powershell prompt with redirected streams Global $hPowerShellPID = Run("powershell.exe", '', @SW_HIDE, BitOR($STDIN_CHILD, $STDERR_MERGED)) ; this little loop is to wait for the "welcome" message from powershell ; just a way to be sure that the powershell is running and "streaming" Do StdoutRead($hPowerShellPID) Until @extended ; out stream started ; example: ; Here we "execute a command via the Powershell that is running in background... ; ...and we get back to resulting output Local $Out = _Run_Cmdlet("Get-ItemPropertyValue 'Registry::HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' -Name 'EnableLUA'", $hPowerShellPID) ConsoleWrite($Out) ; here another command ConsoleWrite(_Run_Cmdlet("dir c:\", $hPowerShellPID)) ; .... and so on ... ; this function execute the passed powershell command and returns the resulting output Func _Run_Cmdlet($sCmd, ByRef $hPS) Local $sStdOut = '' ; we insert a start and an end message in order to identify the "body" of the result of the command executed $sCmd = 'write-host "->StartOfStream<-"; ' & $sCmd & '; write-host "->EndOfStream<-"' & @CRLF StdinWrite($hPS, $sCmd) Do Sleep(250) $sStdOut &= StdoutRead($hPS) ; the presence of the known end message signals the end of the execution Until StringInStr($sStdOut, "->EndOfStream<-" & @LF) ; return only the body of the outpu of the passed command Return _StringBetween($sStdOut, "->StartOfStream<-" & @LF, "->EndOfStream<-" & @LF)[0] EndFunc ;==>_Run_Cmdlet I'm sure you could done your goal with this Enjoy. Thanks @Gianni btw.
-
caramen reacted to a post in a topic: How to run multiple PowerShell Cmdlet in the same instance under AutoIt?
-
send command line to VLC with it open
caramen replied to Belini's topic in AutoIt General Help and Support
This is a solution I get from this post : And I had this script from the topic : (Whitch helped me a lot in lot of similar situation.) It could react the same with your shell console. You have to redefine the code as you need. #include <constants.au3> #include <string.au3> #RequireAdmin ; Use RunAs if you want use a fixed username/password within the script: ; Global $hPowerShellPID = RunAs("UserName", "Domain", "Password", "", "powershell.exe", '', @SW_HIDE, BitOR($STDIN_CHILD, $STDERR_MERGED)) ; or use #RequireAdmin and a simple Run Statement to enter Admin credentials (if needed) at runtime ; Here we start a "permanent" powershell prompt with redirected streams Global $hPowerShellPID = Run("powershell.exe", '', @SW_HIDE, BitOR($STDIN_CHILD, $STDERR_MERGED)) ; this little loop is to wait for the "welcome" message from powershell ; just a way to be sure that the powershell is running and "streaming" Do StdoutRead($hPowerShellPID) Until @extended ; out stream started ; example: ; Here we "execute a command via the Powershell that is running in background... ; ...and we get back to resulting output Local $Out = _Run_Cmdlet("Get-ItemPropertyValue 'Registry::HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' -Name 'EnableLUA'", $hPowerShellPID) ConsoleWrite($Out) ; here another command ConsoleWrite(_Run_Cmdlet("dir c:\", $hPowerShellPID)) ; .... and so on ... ; this function execute the passed powershell command and returns the resulting output Func _Run_Cmdlet($sCmd, ByRef $hPS) Local $sStdOut = '' ; we insert a start and an end message in order to identify the "body" of the result of the command executed $sCmd = 'write-host "->StartOfStream<-"; ' & $sCmd & '; write-host "->EndOfStream<-"' & @CRLF StdinWrite($hPS, $sCmd) Do Sleep(250) $sStdOut &= StdoutRead($hPS) ; the presence of the known end message signals the end of the execution Until StringInStr($sStdOut, "->EndOfStream<-" & @LF) ; return only the body of the outpu of the passed command Return _StringBetween($sStdOut, "->StartOfStream<-" & @LF, "->EndOfStream<-" & @LF)[0] EndFunc ;==>_Run_Cmdlet I'm sure you could done your goal with this Enjoy. Thanks @Gianni btw. -
You have to be carefull. You should use array only with error checking or with uBound but after count the Ubound result to dodge script crashs
-
But I'm not sure about the FileOpenDialog witch I never used. May a FileOpen & FileRead Then FileClose will be enougth. Not time to test. I'm sorry but I guess you got everything to get you done by yourself with that exemple
-
Hello, You could try to read help file about this command : StringInStr & _StringBetween You could use StringInStr to extract a string with one pattern. And re extract if needed. For post traitement with a second pattern Or _StringBetween to do it with two patterns directly with a function. exemple : #include <String.au3> _StringBetween ( $sString, $sStart, $sEnd [, $iMode = $STR_ENDISSTART [, $bCase = False]] ) ;======================= $myStringPat1 = "<WorkOrder code" $myStringPat2 = "</WorkOrder>" $bixfile="BIX File","\\SERVER\blm\ProTube\ProductionLists","bix (*.bix*)" $myWorkOrder = _ExportString ($myStringPat1,$myStringPat2,$bixfile) If IsArray($myWorkOrder) Then ConsoleWrite ("WorkOrder found !"&@CRLF) Else ConsoleWrite ("WorkOrder not found !"&@CRLF) EndIf Func _ExportString ($1,$2,$file) Local $String FileOpenDialog($file) If @error Then Return "Error openning the file" $String = _StringBetween($file, $1, $2 )[0] If @error Then Return "string not found or failure." Else Return $String EndIf EndFunc
-
You could transform this into a better loop. To be sure to intercept everything. if $iPID <> 0 Then $Strm = StdoutRead($iPID, True) if GUICtrlRead($hEdi0001) <> $Strm Then GUICtrlSetData($hEdi0001,$Strm) EndIf EndIf Do Sleep(250) $Strm = StdoutRead($iPID, True) if GUICtrlRead($hEdi0001) <> $Strm Then GUICtrlSetData($hEdi0001,$Strm) EndIf Until <Your statement>
-
caramen reacted to a post in a topic: RDP Automation
-
caramen reacted to a post in a topic: AutoITROLLS (recommendation)
-
seadoggie01 reacted to a post in a topic: Focus problem
-
@Danp2 How is called the management of windows rights in Windows ? What is managing windows Rights ? Any kind of ACL or something ? EDIT : I have to admit I said NTFS because I don't even asked myself about this.
-
Danp2 reacted to a post in a topic: Focus problem
-
This is an abuse of language which means that it is the rules of Microsoft which manages the rights of windows why complicate matters.
-
AutoIt need rights, if you want to touch a window that is actually elevated with admin rights. You could reproduce this with any software that use remote control. This is a NTFS rule. Not sure about MSRA witch would be an exception.