Jump to content

Techn0mancer

Members
  • Posts

    12
  • Joined

  • Last visited

Techn0mancer's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. If that sort of control was required, then striping the blank lines then separating the whole file into sentances then taking each and finding matches in the second file (and number of matches) would be the way to go. Embeded pictures would need a different aproach, Maybe extracting them and a checksum and filesize compare? I assume that is a touch extreme though.
  2. Still reasonably simple to use Xeno's method and feed them into arrays to be a little more granular control, Unless of course the only difference is an extra line feed at the start in which case then treating the whole file as a single variable is obviously the only way to go. It is all very much dependant on the expected data in the file, hence my comment about ini type structure. A line count of both files might allow for some of that, but as you say, a difference in 'gramatical' layout is more tricky to allow for.
  3. Beware of multiple monitor set-ups with that though. I think the @Desktop system info macros only refer to the main screen. (I.E. the one with the start menu on it.)
  4. Is there a reason why you are using pixel colour rather than checking for the windows popping up? Just thinking that using that might be easier: $_Window_Title = "TeamViewer" $_Rez_1="1024x768" $_Rez_2="800x600" While 1 If WinExists($_Window_Title,"razr") Then Set_Screen_Res($_Rez_1) ElseIf WinExists($_Window_Title,"bionic") Then Set_Screen_Res($_Rez_2) EndIf WEndObviously that is only Pseudo-code and a little bit of what would be needed, but hopefully a start for you.
  5. I'd be tempted to read them line by line into 2 arrays, that way you have line numbers sorted. Now, if the RTFs are for something pretty structured almost like an ini then the checks could be done in Autoit reasonably easily though I could see it being faily long-winded. Otherwise you could output each line to a temporary TXT file and use the CMD line file compare (FC), I fear that might be very slow though.
  6. Use an ini file to hold common variables and pass the close commands via that method? <Edit> Beaten to it</Edit>
  7. One non Autoit thing first, I would suggest for machines running Windows 7 to have the disk defrag' run as a scheduled task if at all possible. I recently setup a large number of Win7 machines and the defrag is set to run everyday at 12 noon, that way no machine on our network should get badly fragmented. As it is the task takes about 20s to run on a slow machine at a time when the user is not likely to be doing much but the machine will be on. The task scheduler options are very versatile so you can set it up so that it will not effect the user. On your code; you have done what I think just about everyone new to coding does; Spagetti code. each bit follows on in a long line from the first. This is fine for small tasks, but once you get to the size of your script, it's better to move to using functions for ease of readability if nothing else. Try breaking the script into sections; one for each program you are running, and have each of those as a function; Func Run_CCleaner() Func Run_Wise_Disk_Cleaner() Exit Func Run_CCleaner() <Code goes Here> EndFunc Func Run_Wise_Disk_Cleaner() <Other code goes here> EndFuncYou'll find it much easier to work on. Also, instead of hard coding your sleeps when waiting for wizard windows, think about what a human does, we don't just wait a few seconds and then click a bit on the screen whether or not what we want is there, we watch the UI for the window we want then click the button we want. I see you already have some of that in there when you first launch the programs, but then fall back on hard coded sleeps. Keep up with the WinWaitActive checks, looking for text in the window is a good way of checking if the main wizard title doesn't change, failing that the button labels can be used too. All in all you look like you are on the right path though. Keep us posted on how you get on.
  8. lol, fishing bot for WoW is it? and no, you won't get help for that here.
  9. To answer my own question: Deep Freeze Commandline (DFC) does not output to the standard stream and cannot be picked up by the SDTOutRead, instead it returns a success code that can be utilised directly: Local $Return If FileExists(@SystemDir&"\DFC.exe") Then $Return = RunWait('cmd /c dfc.exe get /isfrozen',@SystemDir,@SW_HIDE) If $Return = 1 Then ConsoleWrite(@CR&"Computer is Frozen."&@CR) ElseIf $Return = 0 Then ConsoleWrite(@CR&"Computer is Thawed."&@CR) Else ConsoleWrite(@CR&"Unspecified error."&@CR) EndIf Else ConsoleWrite(@CR&"DFC.exe not Found, Deep Freeze likely not installed."&@CR) EndIfThere is a table detailing the return codes from DFC.exe in the Faronics documentation which should give all the info we should need. Hope this helps anyone else that encounters this issue.
  10. I'm having an issue getting the commands to output to the STDout stream: #include<Constants.au3> Local $Output $STDOut = RunWait(@ComSpec&" /c dfc.exe get /isfrozen",@SystemDir,@SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $Output = $Output & StdoutRead($STDOut) If @error Then ExitLoop WEnd While 1 $Output = $Output & StderrRead($STDOut) If @error Then ExitLoop WEnd If StringInStr($Output,"THAWED.") Then MsgBox(0,"Test","Workstation is thawed.") ElseIf StringInStr($Output,"FROZEN.") Then MsgBox(0,"Test","Worksation is frozen.") Else MsgBox(0,"Test","Unable to determine workstation state.") EndIfI have tried various combinations using Run, RunWait, @Comspec & ' /c or 'cmd /c' but have had no success. It seems that you cannot do anything like:$STDOut = RunWait(@ComSpec&" /c dfc.exe get /isfrozen >c:\Temp\STDOut.txt",@SystemDir,@SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) either as this breaks the command and nothing is returned at all. Anyone any ideas on how to get this working or to at the very least get the frozen state of the workstation? Obviously this will be tricky for anyone to test unless they have Deep Freeze installed on a test machine. The long and the short of it is I'm writing a tool that will run at startup to check when the last AV and Windows updates were run, if it is longer than a week, the machine is rebooted thawed and the updates are run, but I need to check the Frozen\Thawed state to be able to determine what needs done next.
×
×
  • Create New...