-
Posts
21 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Vivaed's Achievements

Seeker (1/7)
0
Reputation
-
-
Vivaed reacted to a post in a topic: List files in folder, delete all but newest version
-
How to operate a icon in system tray?
Vivaed replied to yarsye's topic in AutoIt General Help and Support
I'm a tad confused, I have TeamViewer running on my task bar and I want to right clich on it and then open a menu item it lists. However this code does not pend results for me. I am assuming that the ToolTip is the the Name that is shown when you "hover" over the icon in the tray, is this correct? Sorry for the cut image: -
List files in folder, delete all but newest version
Vivaed replied to Vivaed's topic in AutoIt General Help and Support
Thanks for the info. The issue at this point is its not displaying the correct information, it returns 0.0.0.0 for all even if the version is 4.0.0.18 In my example I run the function, then I run the FileGetVersion on just on file and the two outputs are different. -
I am trying to read all the files in a folder, then whatever file is newest, keep only that one and delete the rest. Example files: (these all have version numbers embedded in them, I dont want to rely on the file name) Faint.exe Faint-v2.0.exe Faint-v3.0.exe Faint-v4.0.exe What I have so far: #include <File.au3> RemoveOldFiles() ConsoleWrite(FileGetVersion("C:\WB Resources\FAINT_DONT_LINK_THESE\Faint-v4.0.0.exe") &@CRLF) Func RemoveOldFiles() Local $aFileList = _FileListToArray("C:\WB Resources\FAINT_DONT_LINK_THESE\", "*.exe",$FLTA_FILES) For $i = 0 To UBound($aFileList) - 1 $aFileVersion = FileGetVersion($aFileList[$i]) ConsoleWrite($aFileList[$i] & @CRLF) ConsoleWrite($aFileVersion & @CRLF) Next EndFunc OUTPUT: >Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\bot\ownCloud\WellBeats\Delete Old Files\delete-test.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop 3 0.0.0.0 a.exe 0.0.0.0 b.exe 0.0.0.0 Faint-v4.0.0.exe 0.0.0.0 4.0.0.18 <-- This is the correct file version.... +>07:34:26 AutoIt3.exe ended.rc:0 +>07:34:26 AutoIt3Wrapper Finished. >Exit code: 0 Time: 0.6647 Not sure what I am missing here? Thanks!
-
Vivaed reacted to a post in a topic: Running PS1 Script with Parameters
-
Running PS1 Script with Parameters
Vivaed replied to Vivaed's topic in AutoIt General Help and Support
BOOM!!!! Worked! Thank you!!!- 25 replies
-
- ps1
- power shell
-
(and 3 more)
Tagged with:
-
Vivaed reacted to a post in a topic: Running PS1 Script with Parameters
-
Running PS1 Script with Parameters
Vivaed replied to Vivaed's topic in AutoIt General Help and Support
Still barking an error about the space: C:\WB : The term 'C:\WB' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + C:\WB Resources\Wellbeats.Universal_2.2.41.0_Prod\Wellbeats.Universal ... + ~~~~~ + CategoryInfo : ObjectNotFound: (C:\WB:String) [], CommandNotFou ndException + FullyQualifiedErrorId : CommandNotFoundException My code: $iDir = "C:\WB Resources\Wellbeats.Universal_2.2.41.0_Prod\Wellbeats.Universal_2.2.41.0_Prod\Add-AppDevPackage.ps1" Run('cmd /k C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command ' & '"' & $iDir & '"') I wish I could change the space but we have 2000 systems in the field with this naming convention- 25 replies
-
- ps1
- power shell
-
(and 3 more)
Tagged with:
-
Running PS1 Script with Parameters
Vivaed replied to Vivaed's topic in AutoIt General Help and Support
Just tried it, didnt see a window or anything, not sure if even ran, but the app is not installed- 25 replies
-
- ps1
- power shell
-
(and 3 more)
Tagged with:
-
Running PS1 Script with Parameters
Vivaed replied to Vivaed's topic in AutoIt General Help and Support
Keeps throwing an error about the space between C;\WB and Resources C:\Windows\System32\WindowsPowerShell>powershell.exe -Command "C:\WB Resources\APP_Prod\Add-AppDevPackage.ps1" C:\WB : The term 'C:\WB' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + C:\WB Resources\Wellbeats.Universal_2.2.41.0_Prod\Wellbeats.Universal ... + ~~~~~ + CategoryInfo : ObjectNotFound: (C:\WB:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException # I am running As Admin # I also triple checked the path and all spelling, everything looked good- 25 replies
-
- ps1
- power shell
-
(and 3 more)
Tagged with:
-
Running PS1 Script with Parameters
Vivaed replied to Vivaed's topic in AutoIt General Help and Support
Not showing, the window closes when it errors, I wish I could pump the output to the console... is that possible?- 25 replies
-
- ps1
- power shell
-
(and 3 more)
Tagged with:
-
Running PS1 Script with Parameters
Vivaed replied to Vivaed's topic in AutoIt General Help and Support
This gets the Shell to open, I see red text with errors but it closes, thanks for the progress!- 25 replies
-
- ps1
- power shell
-
(and 3 more)
Tagged with:
-
Trying to automate the sideload of a Windows Store app via .ps1 script... RunWait(@ComSpec & ' /c' & 'C:\"WB Resources"\APP_Prod\Add-AppDevPackage.ps1') Above doesn't work... I assume this is trying to open in CMD. Normally we right click the .ps1 and open with powershell, then we have to type "A" to start the install, it installs and then type any yet to exit. However I cant get the powershell to even open. Kind of puzzled here, any suggestions would be a help. PS I also tried to convert the .ps1 to exe, but that was a huge failure... lol
- 25 replies
-
- ps1
- power shell
-
(and 3 more)
Tagged with:
-
I have this button in an app I am building: When you click it, it then opens a FileOpenDialog() I select and XML, then it asks for a name input, enter the name, then it should run the following code: schtasks.exe /create /tn XXXX-task /XML C:\WBRESO~1\WB-LOO~1\TESTIN~1.XML It works when I put it in the CMD and run it, I get SUCCESS! and the new task has been created in Task Scheduler. C:\Users\vivaed>schtasks.exe /create /tn XXXX /xml C:\WBRESO~1\WB-LOO~1\TESTIN~1.XML SUCCESS: The scheduled task "XXXX" has successfully been created. But when I run it in: (This is just a snippet of the code, there is a lot more) #include <AutoItConstants.au3> Global $wbResources = 'C:\"WB Resources"\WB-LoopChecker\' Case $Button4 $getXML = FileOpenDialog("Find task to import", $wbResources ,"XML (*.xml)") If @error Then ; Display the error message. MsgBox($MB_SYSTEMMODAL, "", "No file was selected.") Else Local $taskName = InputBox("Name this task","File: " & @CRLF & $getXML & @CRLF & "Name this task:" & @CRLF,"XXXX-task") $schedTask = 'schtasks.exe /create /tn ' & $taskName & ' /XML ' & FileGetShortName($getXML) Run(@ComSpec & " /c " & $schedTask, @SW_HIDE) ConsoleWrite($wbResources & @CRLF) ConsoleWrite($schedTask & @CRLF) EndIf Here I dont get any errors but the when I refresh the Task Scheduler, there is no new task....
- 2 replies
-
- scheduled tasks
- cmd
-
(and 2 more)
Tagged with:
-
Vivaed reacted to a post in a topic: Parse time from each line of log (text file)
-
Vivaed reacted to a post in a topic: Parse time from each line of log (text file)
-
Parse time from each line of log (text file)
Vivaed replied to Vivaed's topic in AutoIt General Help and Support
@kylomas Thanks for the insight! I have been reading ton about these functions. This script is interesting, it outputs all of the FAILED found but doesn't filter them by only showing the ones from the last 15 mins. since you used _NowCalcDate(), but if I change it to just _NowCalc() I get the results I am looking for. I am very grateful for the code comments, they help me understand what is what and why things are happening!!! -
Parse time from each line of log (text file)
Vivaed replied to Vivaed's topic in AutoIt General Help and Support
Its weird but I just put the snippet of code in the original IF statement: 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 For $sLine In $aFile $aTemp = StringSplit($sLine, ">") $sTime = $aTemp[1] ConsoleWrite($sTime & @CRLF) ;~ FileWrite($file_output,$filteredLine & @CRLF) Local $theDiff = _DateDiff('n', $sTime, _NowCalc()) Next If $theDiff < 15 Then ConsoleWrite($filteredLine & " " & $theDiff & " " & @CRLF) Else EndIf EndIf Else ConsoleWrite( $search & " not found!" & @CRLF) FileWrite($file_output,$search & " not found!" & @CRLF) EndIf Next EndIf FileClose($file_output) EndIf AND ITS OUTPUTTING????? (Kind of) 37 NOW CALC TIME 2016/08/23 12:06:22 2016/08/23 09:01:23 2016/08/23 09:09:28 2016/08/23 09:10:36 2016/08/23 09:11:38 2016/08/23 09:11:41 2016/08/23 09:12:43 2016/08/23 09:14:45 2016/08/23 09:29:45 2016/08/23 09:29:50 2016/08/23 09:29:55 2016/08/23 09:30:33 2016/08/23 09:01:23 2016/08/23 09:09:28 2016/08/23 09:10:36 2016/08/23 09:11:38 2016/08/23 09:11:41 2016/08/23 09:12:43 2016/08/23 09:14:45 2016/08/23 09:29:45 2016/08/23 09:29:50 2016/08/23 09:29:55 2016/08/23 09:30:33 2016/08/23 09:01:23 2016/08/23 09:09:28 2016/08/23 09:10:36 2016/08/23 09:11:38 2016/08/23 09:11:41 2016/08/23 09:12:43 2016/08/23 09:14:45 2016/08/23 09:29:45 2016/08/23 09:29:50 2016/08/23 09:29:55 2016/08/23 09:30:33 2016/08/23 09:01:23 2016/08/23 09:09:28 2016/08/23 09:10:36 2016/08/23 09:11:38 2016/08/23 09:11:41 2016/08/23 09:12:43 2016/08/23 09:14:45 2016/08/23 09:29:45 2016/08/23 09:29:50 2016/08/23 09:29:55 2016/08/23 09:30:33 2016/08/23 09:01:23 2016/08/23 09:09:28 2016/08/23 09:10:36 2016/08/23 09:11:38 2016/08/23 09:11:41 2016/08/23 09:12:43 2016/08/23 09:14:45 2016/08/23 09:29:45 2016/08/23 09:29:50 2016/08/23 09:29:55 2016/08/23 09:30:33 2016/08/23 09:01:23 2016/08/23 09:09:28 2016/08/23 09:10:36 2016/08/23 09:11:38 2016/08/23 09:11:41 2016/08/23 09:12:43 2016/08/23 09:14:45 2016/08/23 09:29:45 2016/08/23 09:29:50 2016/08/23 09:29:55 2016/08/23 09:30:33 2016/08/23 09:01:23 2016/08/23 09:09:28 2016/08/23 09:10:36 2016/08/23 09:11:38 2016/08/23 09:11:41 2016/08/23 09:12:43 2016/08/23 09:14:45 2016/08/23 09:29:45 2016/08/23 09:29:50 2016/08/23 09:29:55 2016/08/23 09:30:33 2016/08/23 09:01:23 2016/08/23 09:09:28 2016/08/23 09:10:36 2016/08/23 09:11:38 2016/08/23 09:11:41 2016/08/23 09:12:43 2016/08/23 09:14:45 2016/08/23 09:29:45 2016/08/23 09:29:50 2016/08/23 09:29:55 2016/08/23 09:30:33 2016/08/23 09:01:23 2016/08/23 09:09:28 2016/08/23 09:10:36 2016/08/23 09:11:38 2016/08/23 09:11:41 2016/08/23 09:12:43 2016/08/23 09:14:45 2016/08/23 09:29:45 2016/08/23 09:29:50 2016/08/23 09:29:55 2016/08/23 09:30:33 2016/08/23 09:01:23 2016/08/23 09:09:28 2016/08/23 09:10:36 2016/08/23 09:11:38 2016/08/23 09:11:41 2016/08/23 09:12:43 2016/08/23 09:14:45 2016/08/23 09:29:45 2016/08/23 09:29:50 2016/08/23 09:29:55 2016/08/23 09:30:33 2016/08/23 09:01:23 2016/08/23 09:09:28 2016/08/23 09:10:36 2016/08/23 09:11:38 2016/08/23 09:11:41 2016/08/23 09:12:43 2016/08/23 09:14:45 2016/08/23 09:29:45 2016/08/23 09:29:50 2016/08/23 09:29:55 2016/08/23 09:30:33 +>12:06:22 AutoIt3.exe ended.rc:0 +>12:06:22 AutoIt3Wrapper Finished. >Exit code: 0 Time: 0.8868 I think this needs to be after FileRead??? I dont really know... But this gets me a step closer lol -
Parse time from each line of log (text file)
Vivaed replied to Vivaed's topic in AutoIt General Help and Support
@JLogan3o13 No it does not, looks like it passes right over it I will do more research on FileReadArray