Du kannst auch den Prozess mal mit dem Api Client von Postman testen.
https://www.postman.com/product/api-client/
gruß gmmg
Du kannst auch den Prozess mal mit dem Api Client von Postman testen.
https://www.postman.com/product/api-client/
gruß gmmg
Hallo Yooh,
ich benutze in paar Skripten auch das WinHttp-Objekt.
Bei meinem PC musste ich aber vorher den folgenden Regkey zur TLS Sicherheit schreiben.
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp", "DefaultSecureProtocols", "REG_DWORD", "2560")
$oHTTP = ""
$URL = 'https://www......'
$sPD = 'der API String'
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("POST", $URL, False)
$oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
$oHTTP.SetRequestHeader("Cache-Control", "no-cache")
$oHTTP.Send($sPD)
$oReceived = $oHTTP.ResponseText
$oStatusCode = $oHTTP.Status
If $oStatusCode <> 200 Then
MsgBox(4096, "Error", $oStatusCode)
_filewritelog(@ScriptDir & "\change.log", " - Error " & $oStatusCode & @CRLF)
Else
_filewritelog(@ScriptDir & "\change.log", " - OK " & $oStatusCode & " " & $oReceived & @CRLF)
EndIf
;RegKEy Eintrag wieder entfernen
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp", "DefaultSecureProtocols")
Alles anzeigen
Gruß gmmg
Ohne das jetzt getestet zu haben, deine Variable $Serverpfad heißt nur Screenshot.jpg, da fehlt der Pfad selber.
Gruß gmmg
Hallo Arno,
mach das doch mit dem PING Befehl.
Function Ping
Ping ( "address/hostname" [, timeout = 4000] )
Gruß gmmg
Hallo Jensen,
anbei einmal die Tabelle per Autoit ausgelesen und als HTML angezeigt.
Die Werte kann man sich natürlich zum Beispiel per StringBetween oder RegEx weiter eingrenzen und weiterverarbeiten.
#include <Array.au3>
#include <IE.au3>
#include <String.au3>
$page = "https://www.mytischtennis.de/clicktt/WTTV/20-21/ligen/3-Kreisklasse-4-VR/gruppe/385717/tabelle/gesamt/"
$oIE = _IECreate($page,0,0) ;Öffne IE versteckt
$sHTML = _IEDocReadHTML($oIE)
_IEQuit($oIE)
;$sHTML = StringReplace ( $sHTML, @LF, "" ) ; eliminates all linefeeds
;$sHTML = StringReplace ( $sHTML, @CR, "" ) ; eliminates all carriagereturn
;$sHTML = StringReplace ( $sHTML, @CRLF, "" ) ; eliminates all carriagereturn-linefeeds
If $sHTML = "" then
MsgBox(0,"", "Nicht verfügbar")
Else
;MsgBox(0,"", $sHTML)
$aHTML_Array = _StringBetween($sHTML, '<h3>Tabelle (gesamt)</h3>', '</table>')
;_ArrayDisplay($aHTML_Array)
MsgBox(0,"",$aHTML_Array[0])
$oIE = _IECreate("about:blank", "url")
_IEBodyWriteHTML($oIE, '<html> ' & $aHTML_Array[0] & '</html>')
EndIf
Alles anzeigen
Gruß gmmg ![]()
@autoiter: Das verstehe ich auch nicht böse gemeint
Eine Schleife deshalb, weil die DB ja auch über verschiedene Pfade offen sein kann ![]()
Wenn zum beispiel eine auf C:\ und eine Kopie auf D:\ oder übers Netzlaufwerk geöffnet ist, heißen die alle Instanzen bei mir alle wie im Beispiel "mitarbeiter:......"
Hier ein Beispiel aus dem engl. Forum.
https://www.autoitscript.com/forum/topic/195488-tab-in-tab/
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
; Create main GUI
$hGUI = GUICreate("Main", 1000, 500)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Events")
; Create tab in main GUI
$cMain_Tab = GUICtrlCreateTab(10, 10, 980, 400)
GUICtrlSetOnEvent($cMain_Tab, "_Events")
$cSound_Tab = GUICtrlCreateTabItem("Sound")
$cVideo_Tab = GUICtrlCreateTabItem("Video")
$cPicture_Tab = GUICtrlCreateTabItem("Picture")
GUICtrlCreateTabItem("")
; Hide main GUI
GUISetState(@SW_HIDE, $hGUI)
$aPos = WinGetPos($hGUI)
ConsoleWrite($aPos[0] & " - " & $aPos[1] & @CRLF)
; Create child GUIs which will appear on tabs
$hChild_Sound = GUICreate("", 960, 350, 20, 40, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
GUISetBkColor(0xFFCCCC, $hChild_Sound) ; Using colours just for example
GUISetState(@SW_HIDE, $hChild_Sound)
$hChild_Video = GUICreate("", 960, 350, 20, 40, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
GUISetBkColor(0xCCFFCC, $hChild_Video)
GUISetState(@SW_HIDE, $hChild_Video)
$hChild_Picture = GUICreate("", 960, 350, 20, 40, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
GUISetBkColor(0xCCCCFF, $hChild_Picture)
GUISetState(@SW_HIDE, $hChild_Picture)
; Now add tabs to the child GUIs
GUISwitch($hChild_Sound)
$cSound_Sub_Tab = GUICtrlCreateTab(10, 10, 940, 320)
$cSound_Sub_Tab_1 = GUICtrlCreateTabItem("Sound_Sub_1")
$cSound_Sub_Tab_2 = GUICtrlCreateTabItem("Sound_Sub_2")
GUICtrlCreateTabItem("")
GUISwitch($hChild_Video)
$cVideo_Sub_Tab = GUICtrlCreateTab(10, 10, 940, 320)
$cVideo_Sub_Tab_1 = GUICtrlCreateTabItem("Video_Sub_1")
$cVideo_Sub_Tab_2 = GUICtrlCreateTabItem("Video_Sub_2")
$cVideo_Sub_Tab_3 = GUICtrlCreateTabItem("Video_Sub_3")
GUICtrlCreateTabItem("")
GUISwitch($hGUI)
; Show Main and initial child GUIs
GUISetState(@SW_SHOW, $hGUI)
GUISetState(@SW_SHOW, $hChild_Sound)
While 1
Sleep(10)
WEnd
Func _Events()
ConsoleWrite(@GUI_CtrlId & @CRLF)
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
Exit
Case $cMain_Tab
; Hide/show child GUIs as required
Switch GUICtrlRead($cMain_Tab)
Case 0
GUISetState(@SW_SHOW, $hChild_Sound)
GUISetState(@SW_HIDE, $hChild_Video)
GUISetState(@SW_HIDE, $hChild_Picture)
Case 1
GUISetState(@SW_HIDE, $hChild_Sound)
GUISetState(@SW_SHOW, $hChild_Video)
GUISetState(@SW_HIDE, $hChild_Picture)
Case 2
GUISetState(@SW_HIDE, $hChild_Sound)
GUISetState(@SW_HIDE, $hChild_Video)
GUISetState(@SW_SHOW, $hChild_Picture)
EndSwitch
EndSwitch
EndFunc
Alles anzeigen
Gruß gmmg
Mit der MetroGUI-UDF soltle das auch gehen.
Gruß gmmg
Probiere doch mal Tooltip oder SplashTextOn aus der Hilfe
ToolTip("This is a tooltip", 10, 10)
Sleep(300) ; Sleep to give tooltip time to display
ToolTip("", 0, 0)
gruß gmmg
@drnatas:
Du brauchst die entsprechenden Webdriver von hier "https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-05252020/" und die
Webdriver Source von Danp2 für Autoit https://github.com/Danp2/WebDriver/releases/tag/0.3.0.1
Hier mal ein Beispiel von einem Autologin der Website Slidepresenter
#include "wd_helper.au3"
#include "wd_core.au3"
#include <MsgBoxConstants.au3>
$file = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
If FileExists($file) Then
$Fileversion = FileGetVersion($file)
;------------------------------------------------------------------
;Abfrage der google Chrome Version, danach setze den entsprechenden Chromedriver, falls ein Client noch nicht den aktuellen Chrome benutzt. -> umgebaut auf dynmische abfrage
;~ IF StringLeft($Fileversion,2) = "76" Then $webdriver = "chromedriver_76.exe"
;~ IF StringLeft($Fileversion,2) = "77" Then $webdriver = "chromedriver_77.exe"
;~ IF StringLeft($Fileversion,2) = "78" Then $webdriver = "chromedriver_78.exe"
;~ IF StringLeft($Fileversion,2) = "79" Then $webdriver = "chromedriver_79.exe"
;~ IF StringLeft($Fileversion,2) = "80" Then $webdriver = "chromedriver_80.exe"
;------------------------------------------------------------------
; dynmische abfrage der GoogleChrome Version und nutze danach den richtigen Webdriver
$gchrome_version = StringLeft($Fileversion,2)
$webdriver = "chromedriver_" & $gchrome_version & ".exe"
Else
MsgBox(0,"Info","Google Chrome in der richtigen Version nicht vorhanden.")
Exit
EndIf
$mail = "username"
$pass = "pass"
$_WD_DEBUG = $_WD_DEBUG_None ;set to $_WD_DEBUG_None before compiling.
;Global $_WD_DRIVER
Local $sDesiredCapabilities
Local $iIndex
$url = "https://app.slidepresenter.com/#/login"
;SetupGecko() ;use for Mozilla
SetupChrome() ;use for Google Chrome
_WD_Startup()
$sSession = _WD_CreateSession($sDesiredCapabilities)
_WD_Navigate($sSession, $url)
_WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='email']")
ConsoleWrite("+ @error = " & @error & @CRLF)
$sElement_mail = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='email']")
_WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='password']")
ConsoleWrite("+ @error = " & @error & @CRLF)
$sElement_pass = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='password']")
If @error = $_WD_ERROR_Success Then
_WD_ElementAction($sSession, $sElement_mail, 'value',$mail)
EndIf
If @error = $_WD_ERROR_Success Then
_WD_ElementAction($sSession, $sElement_pass, 'value',$pass)
EndIf
Sleep(1500)
Send("{ENTER}")
;_WD_DeleteSession($sSession)
_WD_Shutdown()
Func SetupChrome()
;_WD_Option('Driver', 'chromedriver.exe')
_WD_Option('Driver', 'data\'& $webdriver)
_WD_Option('Port', 9515)
;_WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"')
_WD_Option('DriverParams')
$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"unhandledPromptBehavior": "ignore", ' & _
'"goog:chromeOptions": {"w3c": true, "excludeSwitches": ["enable-automation"], "useAutomationExtension": false, ' & _
'"prefs": {"credentials_enable_service": false},' & _
'"args": ["start-maximized"] }}}}'
EndFunc
Func SetupGecko()
_WD_Option('Driver', 'geckodriver.exe')
;_WD_Option('DriverParams', '--log trace')
_WD_Option('DriverParams')
_WD_Option('Port', 4444)
$sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}'
EndFunc
Gruß gmmg ![]()
musst du da nicht auch einfach die Website auslesen.
Ein ausführen als anderer Benutzer funktioniert wohl nicht? Das heißt, du bist z.B. per TeamViewer auf dem Client und startest dann dein Setup, indem du mit Shift + Rechtsklick auf die Datei das Menü "Als anderer Benutzer ausführen" aufrufst. Das UAC Aufforderung kann man dan doch auch bestätigen.
Gruß gmmg
Hallo Zusammen,
man könnte das auch über die lokale Gruppenrichtlinie "gpedit.msc" machen.
https://www.windows-faq.de/2017/01/13/scr…ows-ausfuehren/
Gruß gmmg ![]()
Racer : Natürlich sollte man bestimmte Schutzmechanismen nicht unkontrolliert deaktivieren, da gebe ich dir recht.
Das Video oder dessen Inhalt ist sicher nicht gefährlich und in dem Fall geht es schlichtweg um den Test des Autoit Scriptes.
Da der Themen Ersteller mit seinem Workaround klar kommt, kann hier sicher auch geschlossen werden.
gruß gmmg
Geht nicht, gibst nicht
Was sagt hier eigentlich das Eventlog (Ereignisprotokoll)? Ist der Applocker per GPO aktiv?
Gruß gmmg
hilft der Youtube Beitrag "How to Fix Run As Administrator Not Working in Windows 10" eventuell etwas ?
Gruß gmmg