
Fyzzle
Members-
Posts
17 -
Joined
-
Last visited
Everything posted by Fyzzle
-
The scenario I have is that I have to go online to request keys for software packages and I would like to script out as much as possible. I've automated getting the key but I would like to be able to select it and assign it to a variable for later use, and I'm not sure how to get it. Here's the spot in the page where I can see it, i've changed the key around so it's not a real key, but obviously it will change every time. <tr> <td>Activation Id: <div class=note>Activation Id is Case Sensitive</div> </td> <td>e12a-daf6-812d-4abe-b9h2-3acb-9qqf-0709</td> </tr> There's also a second spot where it appears, not sure if that would work better or not. <tr> <td>Details:</td> <td><a href="/wba/licenseDetails.do?license=e12a-daf6-812d-4abe-b9h2-3acb-9qqf-0709&server=FNO" target="_blank">License details</a></td> </tr> I've looked at _IEBodyReadText but I don't see a way to just pull a key out of the code, anyone run into something like this yet? Clicking that link gets me to another page but is not anymore helpful with any objects I can reference. Thanks guys.
-
And here is what I have going from the txt file. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> ;==================================================== ;Globals ;==================================================== Global $computernamefile = fileopen("C:\computers.txt",0) ;==================================================== ;GUI ;==================================================== $Form1 = GUICreate("Update Util", 257, 111, 383, 155) $filelocationlabel = GUICtrlCreateLabel("File location", 8, 16, 60, 17) $filefind = GUICtrlCreateButton("Browse", 72, 8, 75, 25, $WS_GROUP) $targetcomputerlabel = GUICtrlCreateLabel("Target Computer", 8, 48, 83, 17) $computername = GUICtrlCreateInput("", 96, 48, 121, 21) $Label = GUICtrlCreateLabel("Target location: C:\TA", 40, 80, 178, 17) $Go = GUICtrlCreateButton("Go", 200, 8, 43, 25, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Go gomango() Case $filefind $filelocation = FileOpenDialog("Locate front end", "C:\", "Databases (*.mdb;*.accdb)", 5) If @error Then MsgBox(4096,"","No File(s) chosen") Else $filelocation = StringReplace($filelocation, "|", @CRLF) EndIf Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd ;==================================================== ;Main Process ;==================================================== Func gomango() If $computernamefile = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf While 1 Global $computername = FileReadLine($computernamefile) If @error = -1 Then ExitLoop Pushfile() Wend FileClose("C:\computers.txt") EndFunc ;==================================================== ;Functions ;==================================================== Func Pushfile() FileCopy($filelocation,"\\" & GUICtrlRead($computername) & "\C$\TA\", 9) ;MsgBox(4096,"Complete","Copy completed to " & $computername) EndFunc
-
---=== New stuff below ===---
-
---=== New stuff below ===---
-
Yeah one sec and i'll get the code, it's been butchered and I need to clean it up. 1. I have admin rights on these computers and they are on the local network. Sorry for not specifying. 2. I'm using filecopy to move the file from $filelocation = fileopendialogue to $targetlocation = guictrlcreateinput That's some cool stuff though madscientist, if you don't mind i'll hold onto that for a future project
-
Heyas, I need to be able to maintain a list of computers, at any time I need to be able to push a specific file (which i'll browse for) to a preset location on these computers. Sometimes it may be two PCs, other times it may be 12. I also need to be able to edit the list of computers on occasion, I could live with containing it in a txt file and editing it with notepad if needed. I just need something that works. How on earth do I accomplish this? If you have the code it'd be nice, but if you could just point me to the commands needed and recommend a process I would be equally grateful. I can get the whole process done fine if i'm only doing one computer at a time by having a textbox to type the computer name into. What would be the easiest way to do this? Many thanks.
-
Searching a file for a line of text
Fyzzle replied to Fyzzle's topic in AutoIt General Help and Support
Cocaine is one hell of a drug.... That's working beautifully, and the _arraydisplay is a lot simpler than I was making it The output to the array is: XXAXX-XX2XX-XXqXX-XXwXX-XX0XX 12343-XX24X-XXqXX-XXwXX-XX0XX I understand why, working on how to get it to display the actual data. -
Searching a file for a line of text
Fyzzle replied to Fyzzle's topic in AutoIt General Help and Support
Hey no worries, i'll see if I can get my head around it myself tonight when I get home. At the very least it may point me in the right direction. -
Searching a file for a line of text
Fyzzle replied to Fyzzle's topic in AutoIt General Help and Support
I made this string up outside of Autoit and it works. ^\"SerialNum\"=\"[0-9A-Z]{5}-[0-9A-Z]{5}-[0-9A-Z]{5}-[0-9A-Z]{5}-[0-9A-Z]{5}\"$ I'm missing something here... I misinterpreted as well, a return of 1 is error with a 3 flag. So it looks like yours is good as well (not that I doubted) -
Searching a file for a line of text
Fyzzle replied to Fyzzle's topic in AutoIt General Help and Support
Oi never mind When i add the single quotes to the pattern in order for the variable to be accepted it ruins the pattern. Back to the drawing board. It just doesn't seem to like all the quotes. Grats BTW on the medals in Vancouver I noticed you're from Germany. -
Searching a file for a line of text
Fyzzle replied to Fyzzle's topic in AutoIt General Help and Support
Nice, you replied before I edited my lunacy Dim $searchString = "path" $OpenFile = FileOpen($searchString, 1) FileRead($OpenFile) $Key = StringRegExp($OpenFile, '"SerialNum"="(\w*[-"])+',3) MsgBox(0, "Test", $Key) FileClose($OpenFile) This returns a 1 so it looks like it's finding it. Is there a way to output the array to a file with the results? I was just using the MsgBox for testing. What I am doing is putting this in the startup script and having the output go to a log file with a bunch of other stuff I like to gather. -
Searching a file for a line of text
Fyzzle replied to Fyzzle's topic in AutoIt General Help and Support
Wow thanks for the quick reply. Edit: I simplified what I was doing, hopefully I just missed something small, reposting once I have the code narrowed down to the easiest form that works -
Heya, What I'm trying to do is look into .cfg files (which are formatted like txt files) and pull out registration numbers to audit our network on a specific software piece. The line is: "SerialNum"="XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" Quotes are included in the line and it occurs on different lines of the config file depending on version, options, etc so a filereadline isn't going to work. I have been reading into Regex but I admit it's a bit over my head at the moment. I'm hoping that seeing this example in action will help things come together. I have most of the script written but I can't get that value. Is anyone able to help?
-
Running install on computers from a file
Fyzzle replied to Fyzzle's topic in AutoIt General Help and Support
Scratch that, I just had to dig deeper http://www.autoitscript.com/forum/index.php?showtopic=106273&st=0&p=750410&hl=filereadline%20function&fromsearch=1&#entry750410 -
Heya everyone, i've been digging around a bit and i've gotten close. I have a script that uninstalls the old AV from a computer and installs our new AV, logs, reports over email, works great. What I want to do is create a .txt file with the rest of the computer names on the network that need this done. The script goes down the list line by line and executes the function. I know I need to use filereadline but the recursion is a bit past me at the moment. Would anyone be able to help? If I missed something in the search could you point me to the thread? I may have been looking for this the wrong way. Thanks
-
Brilliant, thanks
-
I'm setting up some scripts for family members to automate some of their more mundane tasks. This is what I have for the related functions: Func defrag() ShellExecuteWait("C:\Program Files\Defraggler\Defraggler.exe","c:\") EndFunc And also Func defragcnfg() ShellExecuteWait('schtasks.exe','/create /SC DAILY /TN fragme /TR "\"C:\Program Files\Defraggler\Defraggler.exe"c:\" /ST 00:15:00 /RU SYSTEM') EndFunc What i'd like to do is have an input asking which drives they would like defragged, then both functions reference the output to run now, and schedule. Anyone have any recommendations? I'm fairly new to autoit, and I did quite a bit of searching but I may have overlooked something awesome.