-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By MarkBuchanan
Hello,
I am new to AutoIt so please bare with me. I am trying to write a script that installs a certain program on Win 10 and then based on a successful install create a file in a specific directory. Below is my install script which works, just not quite sure how to get it to write the file when its done. My thought is to add a "If FileExists" command at the end to make sure that the files are in the install folder and based on that write the file just not sure how to accomplish it. I hope that makes sense and thank you in advance for any help.
Local $Title="MobilePass Install"
Local $FilePATH="\\XXXXXXX\XXXXXX"
Local $UserName "*****8"
Local $Password = "*******8" ;Check if Application location already exists
If FileExists ("C:\Program Files\WindowsApps\05EB1CFA.SafeNetMobilePASS_1.8.3.0_x64__bnm8hg3x9na9j") Then
Exit
Else
Local $pid = RunAsWait ($UserName, $ComputerDomainName, $Password, 1, "MobilePASS+Setup_1.8.3.0_signed.exe", "", @SW_HIDE )
Endif
-
By Alok_Arora
Hello Sir,
While searching for the solution to my problem, I have just gone through some of your old post.
My name is Alok Arora
Email id is *snip*
I am writing a code to store logs for each script I run. This I did by using FileWriteLog function and it is successfully storing logs in txt file.
Now, I have to work on to read the log file and if any script has been mistakenly clicked twice in a day script will pop up a message that task already done for the day by verifying entries in the log file.
I have the logic for it..
I mean a variable will read the log file and will search for the entry and will perform action if entry found or not.
I believe for reading the file I can write a code like
$i =fileread("logfile.txt")
Now I am stuck on how to compare the log entry in log file.
Can you please help me in this?
-
By Danyfirex
Hello guys. It's been awhile since I shared something. So today I want to share my last project.
What's Loga?
Loga is a simple logging library to keep track of code with an integrated console.
Features.
Common log levels. Integrated console. Multiple instances. Custom color and font for each instance log level. Define output format with macros. Conditional and occasional Logging. Easy to use. Basic Usage:
#include "..\Loga.au3" ;This are some of the default settings: ;Default log level $LOGA_LEVEL_TRACE ;output format: {Symbol}{LogIndex} {LevelName} {LongDateTime} {Message} ;Log to File is enabled. ;Log file name format: YYYYMMDDHHMM-Loga-InstanceIndex.log ;Custom Console is disabled by default. ;By default log to STDOUT. _LogaTrace("I'm Trace") _LogaDebug("I'm Debug") _LogaInfo("I'm Info") _LogaWarn("I'm Warn") _LogaError("I'm Error") _LogaFatal("I'm Fatal")
More examples here.
Check Loga on GitHub.
Loga Latest Release v1.0.2.
Saludos
-
By Vivaed
I have another AutoIT script making a Log file
Sample of Log file:
2016/08/22 12:44:18 > Process: [RUNNING] [ACTIVE] 2016/08/22 12:48:35 > Process: [WAS NOT RUNNING] 2016/08/22 13:40:00 > Process: [FAILED] 2016/08/22 14:01:10 > Process: [WAS NOT RUNNING] I am looping through the Log file for the word "FAILED"
I then want to get all lines that have "FAILED" and get their TIME
My Current code to get this far:
If FileExists($fileLog) Then $contents = FileRead($fileLog) If @error Then MsgBox(0, 'File Error', $fileLog & ' could not be read.') Else For $i = 1 To _FileCountLines($fileLog) $result = StringInStr($contents,$search) If $result >= 1 Then $filteredLine = FileReadLine($fileLog,$i) If StringInStr($filteredLine,$search) Then ConsoleWrite($filteredLine & @CRLF) ; this gets me the results I want sans the time parse EndIf Else ConsoleWrite( $search & " not found!" & @CRLF) EndIf Next EndIf EndIf For this part:
If StringInStr($filteredLine,$search) Then ConsoleWrite($filteredLine & @CRLF) ; this gets me the results I want sans the time parse EndIf OUTPUT: 2016/08/22 13:40:00 > Process: [FAILED] I dont understand how I read the time in that output?
I have tried _DateTimeFormat - Dont think this applies
Tried _DateDiff - I dont have a the date yet so this doesnt work
Would love if someone could tell me if I am thinking is the wrong direction and possibly lead me down the correct path to light side of the force
-
By mmoalem
Hi there - quite a beginner to codding so please bare with me...
i am writing an autoit code that will be running 24/7 executing various tasks every 10-20 minutes. it suppose to run on unattended server but i would like to occasionally remote log in and do stuff on the server without disturbing the autoit script (while the autoit script is in Sleep count). to achieve this I will need to know at what point in the commands run it is and how long roughly until the next command (I use Sleep in between commands)...
so, is there a way to create a monitor that shows me the last command executed and how long of the Sleep is left (like in a small window or in the windows task bar)?
failing that any idea how can I utilize the FileWriteLog function to keep updating an always open text file ?
thanks in advance
michel
-
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now