Search the Community
Showing results for tags 'export date to file'.
-
Hello, I am a beginner when it comes to scripting but I am learning fast. I made a script to automate SAP login for work. I made this because we have 125 SAP instances and they all have a password that expires in 1 month if the agent doesn't log in. I need a script to export date details to .txt for when it was last runned so we can tell if that SAP instance password needs to be changed soon or it can wait. Can someone please help or give me a suggestion or a tip? This is the script. I know is very basic but I am beginner. PS: I ran the SAPLOGON application from cmd cuz it doesn't work if I just try to run it with "Run SAPLOGON.exe" Thanks in advance #include <GUIConstantsEx.au3> Run("cmd.exe") WinWait("C:\Windows\system32\cmd.exe") Send("start saplogon.exe") Send("{ENTER}") sleep(3000) WinClose("C:\Windows\system32\cmd.exe") WinActivate("SAP Logon 730", 5) ControlClick("SAP Logon 730", "", "[CLASS:Edit1]") Send("Everest MP EP1") Sleep(1000) Send("{ENTER}") WinActivate("SAP") Sleep(2000) $Ini = @ScriptDir& '\Username.txt' If FileExists($Ini) Then Local $TextIniRead1 = IniRead($Ini, "Paste", "1", "Not found") Else IniWrite($Ini, "Paste", "1", 'Username') EndIf HotKeySet('{-}', 'Username') Func Username() ConsoleWrite($TextIniRead1 & @CRLF) Send($TextIniRead1) EndFunc ;==>Mail1 Sleep(1000) Send("{-}") Sleep(2000) Send("{TAB}") $Ini = @ScriptDir& '\Password.txt' If FileExists($Ini) Then Local $TextIniRead1 = IniRead($Ini, "Paste", "1", "Not found") Else IniWrite($Ini, "Paste", "1", 'Password') EndIf HotKeySet('{+}', 'Password') Func Password() ConsoleWrite($TextIniRead1 & @CRLF) Send($TextIniRead1) EndFunc ;==>Mail1 Send("{+}") Sleep(1000) Send("{ENTER}") Sleep(1000) WinActivate("SAP Easy Access") Sleep(4000) WinClose("SAP Easy Access") Sleep(2000) WinActivate("SAP Logon 730") Sleep(4000) WinClose("SAP Logon 730")