-
Posts
296 -
Joined
-
Last visited
-
Days Won
1
sahsanu last won the day on August 11 2014
sahsanu had the most liked content!
About sahsanu
- Birthday 11/15/1977
Profile Information
-
Member Title
miniyo
-
Location
Zaragoza, Spain
sahsanu's Achievements
-
Liuck97 reacted to a post in a topic: Serial/Licensing system
-
kristoff1313 reacted to a post in a topic: Display information from WMI in MsgBox
-
freddykid reacted to a post in a topic: Get Reverse DNS Name
-
jimmer reacted to a post in a topic: Serial/Licensing system
-
Send email error - _INetSmtpMailCom error 2
sahsanu replied to AutID's topic in AutoIt General Help and Support
I just created an account in outlook.com to test it and it is working fine for me using port 25 and SSL enabled but I'm not using smtp.live.com, according to Microsoft doc it should be smtp-mail.outlook.com and as I said it is working fine. Cheers, sahsanu -
Send email error - _INetSmtpMailCom error 2
sahsanu replied to AutID's topic in AutoIt General Help and Support
Use SSL and port 587 instead of 25. Edit: In case it fails on port 587 too, use 465 instead, always with SSL activated. -
Get directory list on multiple machines
sahsanu replied to JohnSte's topic in AutoIt General Help and Support
I'm a bit bored so... Script to be used on machine 1: #include <Array.au3> #include <File.au3> $sPathMachine1 = @ScriptDir & "\root_folder_machine1" ;path to root folder on machine 1 $aListMachine1 = _FileListToArrayRec($sPathMachine1, "*", $FLTAR_FOLDERS, $FLTAR_RECUR, $FLTAR_SORT) ;_ArrayDisplay($aListMachine1) ;uncomment this line if you want to view the list of dirs found on machine 1 _FileWriteFromArray(@ScriptDir & "\listdir_machine1.txt", $aListMachine1, 1) Copy the file created "listdir_machine1.txt" to machine 2, then execute this script: #include <Array.au3> #include <File.au3> $sPathMachine2 = @ScriptDir & "\root_folder_machine2" ;path to root folder on machine 2 $sPathListMachine1 = @ScriptDir & "\listdir_machine1.txt" ;path to file copied from machine 1 which contains the list of dirs Local $aListMachine1 _FileReadToArray($sPathListMachine1, $aListMachine1) ;read the file and put the content in an array ;_ArrayDisplay($aListMachine1) ;uncomment this line if you want to view the array created For $i = 1 To $aListMachine1[0] $sCheckPath = $sPathMachine2 & "\" & $aListMachine1[$i] If Not FileExists($sCheckPath) Then ;here you should write the code to create the dirs ConsoleWrite("This dir should be created on machine 2: " & $sCheckPath & @CRLF) EndIf Next There are several comments inside the code. I hope this could be a start to write your own script Cheers, sahsanu -
Get directory list on multiple machines
sahsanu replied to JohnSte's topic in AutoIt General Help and Support
If you take a look to example script in _FileListToArrayRec() function you'll find it ;-) -
Try this code: Global $IPAddress1 = "192.168.1.37" Global $IPAddress2 = "192.168.1.40" Global $IPAddress3 = "192.168.1.41" Global $IPArray[3] = [$IPAddress1, $IPAddress2, $IPAddress3] _Ping() ;If you want lo limit the tries to ping all the machines simply add the number of tries _Ping(20) for example, by default are 10 If @error Then ConsoleWrite("One or more machines are down." & @CRLF) Else ConsoleWrite("All machines are up and running." & @CRLF) EndIf Func _Ping($iMaxtries = 10) $iCountTotal = 0 Do $iCount = 0 For $p = 0 To UBound($IPArray) - 1 $PingTemp = Ping($IPArray[$p], 250) If Not @error Then $iCount += 1 Sleep(100) Next $iCountTotal += 1 If $iCountTotal = $iMaxtries And $iCount < 3 Then Return SetError(1, 1, 1) EndIf Sleep(500) Until $iCount = 3 Return 0 EndFunc ;==>_Ping Cheers, sahsanu
-
sahsanu reacted to a post in a topic: How to replace parts of the same part of the keyword in the text?
-
As Jos said, you could take a look to help file, in StringRegExp you have a good refrence for regular expressions. And this is what the regular expression does: (?s)(.*project.*?version=")(.*?)(".*) Options: Case sensitive; Exact spacing; Dot doesn't match line breaks; ^$ match at line breaks; Greedy quantifiers; Regex syntax only Use these options for the whole regular expression «(?s)» &Dot matches line breaks «s» Match the regex below and capture its match into backreference number 1 «(.*project.*?version=")» Match any single character «.*» Between zero and unlimited times, as many times as possible, giving back as needed (greedy) «*» Match the character string “project” literally (case sensitive) «project» Match any single character «.*?» Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?» Match the character string “version="” literally (case sensitive) «version="» Match the regex below and capture its match into backreference number 2 «(.*?)» Match any single character «.*?» Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?» Match the regex below and capture its match into backreference number 3 «(".*)» Match the character “"” literally «"» Match any single character «.*» Between zero and unlimited times, as many times as possible, giving back as needed (greedy) «*» ${1}0.0.0${3} Insert the text that was last matched by capturing group number 1 «${1}» Insert the character string “0.0.0” literally «0.0.0» Insert the text that was last matched by capturing group number 3 «${3}» Cheers, sahsanu
-
For me it isn't clear if you wants to replace all version fields or just project part so if you want to replace all version fields go ahead with mikell regexp (mikell is really good with regular expressions ). if you just want to replace field version for project part you could use something like this: $txt = FileRead("1.txt") $txt = StringRegExpReplace($txt, '(?s)(.*project.*?version=")(.*?)(".*)', "${1}0.0.0${3}") FileWrite("2.txt", $txt) Cheers, sahsanu
-
sahsanu reacted to a post in a topic: LFN UDF - overcome MAX_PATH limit of 256 chars
-
If I understood the question, I think this could fit your needs (comments in code): Local $ProcessNameList[3][2] = [["CALC.EXE", ""], ["NOTEPAD.EXE", ""], ["MSPAINT.EXE", ""]] ;Define a 2D array to store the process name and in the second column the pids of running applications While 1 For $i = 0 To UBound($ProcessNameList) - 1 ;read the array in a for loop If ProcessExists($ProcessNameList[$i][0]) Then ;if the process exists then we will check it $aPid = ProcessList($ProcessNameList[$i][0]) ;get the pids for all instances of process name If IsArray($aPid) Then ;if we got the list continue For $x = 1 To $aPid[0][0] ;we will check in a for loop if the pid process is already in our list If Not StringInStr($ProcessNameList[$i][1], "|" & $aPid[$x][1] & "|") Then ;if the pid process is not in our list (second column of our process name array)... MsgBox(0, "Process running", $ProcessNameList[$i][0] & " is running with pid " & $aPid[$x][1]) ;... then show a message... $ProcessNameList[$i][1] &= "|" & $aPid[$x][1] & "|" ; ... and add the pid in our list (second column of our process name array) EndIf Next EndIf EndIf Next Sleep(500) WEnd Cheers, sahsanu
-
Trouble with command line parameter in RunWait()
sahsanu replied to tykkimies's topic in AutoIt General Help and Support
Regarding 64 bit OS, if you are launching now the command from a 64 bits OS to test it, believe me, it could made the difference . Try to run the command without @comspec, the command directly: RunWait('\\pafile\WindebtXL\WINDEB~1\WinDeb~1\Setup\setup.exe /s /v"/qn /L*v \"%temp%\wdins.log\" USERNAME="Lmm" AGREETOLICENSE=Yes COMPANYNAME=\"Lmm Management\""') Keep in mind that %temp% could not be expanded so you have two options, remove %temp% and put the full path for temp dir or add this option in your script: Opt("ExpandEnvStrings",1) RunWait('\\pafile\WindebtXL\WINDEB~1\WinDeb~1\Setup\setup.exe /s /v"/qn /L*v \"%temp%\wdins.log\" USERNAME="Lmm" AGREETOLICENSE=Yes COMPANYNAME=\"Lmm Management\""') By the way, do you need to quote this?: "/qn /L*v \"%temp%\wdins.log\" USERNAME="Lmm" AGREETOLICENSE=Yes COMPANYNAME=\"Lmm Management\"" And why are you escaping several ?. You could also try several variants of the command: RunWait('\\pafile\WindebtXL\WINDEB~1\WinDeb~1\Setup\setup.exe /s /v"/qn /L*v \"%temp%\wdins.log\" USERNAME="Lmm" AGREETOLICENSE=Yes COMPANYNAME=\"Lmm Management\""', @ScriptDir) RunWait('\\pafile\WindebtXL\WINDEB~1\WinDeb~1\Setup\setup.exe /s /v /qn /L*v "%temp%\wdins.log" USERNAME="Lmm" AGREETOLICENSE=Yes COMPANYNAME="Lmm Management"') RunWait('\\pafile\WindebtXL\WINDEB~1\WinDeb~1\Setup\setup.exe /s /v /qn /L*v "%temp%\wdins.log" USERNAME="Lmm" AGREETOLICENSE=Yes COMPANYNAME="Lmm Management"', @ScriptDir) If none works... I'm running out of ideas Cheers, sahsanu -
Trouble with command line parameter in RunWait()
sahsanu replied to tykkimies's topic in AutoIt General Help and Support
If you are in a 64 bits OS put this on top of your script and try again: #AutoIt3Wrapper_UseX64=y If that doesn't work add #RequireAdmin too: #RequireAdmin #AutoIt3Wrapper_UseX64=y