
clicked
Active Members-
Posts
51 -
Joined
-
Last visited
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by clicked
-
How to simulate user input in console apps?
clicked replied to TheDcoder's topic in AutoIt General Help and Support
"Send" keystrokes worked into XP CMD windows, but injecting keystrokes into console apps is now blocked by Microsoft, and has been since 2008R2: http://blogs.technet.com/b/askperf/archive/2009/10/05/windows-7-windows-server-2008-r2-console-host.aspx This was a nasty shock for me when I developed a large testing app in XP and it did not work in the 2008R2 deployment environment. However, I found that you can redirect input. My particular use cases required specific, predictable keystrokes to start command line apps and provide command line inputs, so I created text files and started my CMD windows with the input redirected from the text file. This works fine but you have to know the entire input session from beginning to end for this to work, as you can't modify the input files once the session has begun. If you want to start a CMD and inject commands on-the-fly, then you will have to do something tricky, such as start a CMD window with a BAT file that checks another BAT file at intervals, and executes the commands in there. -
There is this: https://support.microsoft.com/en-us/kb/977357 and there may be other issues with it. I used WMI inside a 1 second loop to get CPU usage, and ended up with gigabytes of private memory. It took me a long time to suspect WMI, but simply moving the ObjGet outside the loop fixed the problem. You can put a WMI ObjGet inside a tight loop yourself, as a test, and watch the memory run up.
-
I think the memory leak is in the WMI object. I believe this is a known bug you can google up. I see you are connecting to an array of computers, I would store the WMI handles in an array and ObjGet them once only.
-
Resolving a fully-qualified Windows program filename
clicked replied to MikeK6MKF's topic in AutoIt General Help and Support
Other options: If you are looking for a particular executable that is in your PATH, you can issue a "cmd /c where" to find it. If you are looking to open a document with the standard binding, "cmd /c start" will open it (although, it sometimes has trouble with spaces in the filename even if you quote it). -
For file comparison, I have had success with the levenshtein algorithm. Unfortunately my code was not in autoit. However if you have a file matching/comparison problem, you could do worse than take a look at this. http://en.wikipedia.org/wiki/Levenshtein_distance For more googling, Levenshtein is one solution to the "longest common subsequence" problem.
-
One thing you can do, which I have found helpful, is to run MSTSC, and then after a few seconds to send a CR into the Remote Desktop. This will dismiss those ultra-annoying Legal Captions that block scripts running from the startup menu. Once the Remote Desktop is cooking, though, the answer orbs provided is the only way.
-
This is an excellent discussion. I learned much about the "unknowability" of exact time by reading the Boost library intro to its date/time module: http://www.boost.org/doc/libs/1_57_0/doc/html/date_time/details.html
-
You could also try running as a scheduled task. Not sure what you are trying to do, but interaction with a GUI (which is the primary value of AutoIt) requires a GUI context, and Windows is very particular about that. The only way to get one is to log the script into one, such as with a remote desktop. I've found that if you "X" out of the RD, the GUI context goes away, therefore you need to be logged in all the time. VMs are ideal for this, because you can turn on auto admin logon into the console, turn off legal caption, and create a Startup item to launch your script. But this is neither a service nor a scheduled task.
-
Problems running a compiled script as a service
clicked replied to Trax's topic in AutoIt General Help and Support
You probably already compiled-to-exe as a console application, but this might be worth checking. -
Are you more clever than Au3Info and ControlViewer ?
clicked replied to Exit's topic in AutoIt General Help and Support
I've noticed that controls sometimes get hidden by their container, and AuInfo can't find them. Not sure why. However, all controls are named in predictable ways, e.g. "Edit1", "ListBox2" etc. These instance names are just strings, so they are easily constructed. I wrote a simple script that visits the first 50 (or whatever) control instance names and writing out the text. You can then usually match up the text in the control with the text printed out by the script. -
You will need a loop to wait for an expected screen to appear, and probably an outer loop to wait for an expected sequence of screens. Click "Next" or "Accept" or whatever button is needed to transition between screens. Plenty of examples in the help files.
-
How to send large strings over http?
clicked replied to Rutger83's topic in AutoIt General Help and Support
You may also need to send large data in chunks, and sleep briefly to give the receiver time to catch up. TCP flow control is supposed to do this, but I found threads suggesting that this is necessary, and I did it for my own projects. Also worth considering, I just read a thread that uses PNG as a compression tool, very interesting, and it might have the size of the data you need to send. Happy coding. -
Solved, Just export the policy as XML. The XML file contains an indication of audit-only or enforcement for each policy type (exe, dll, script, installer).
-
My comment didn't come over like I wanted it to. I actually didn't think of googling applocker registry settings or wmi, so I am grateful for your suggestion. Thanks again.
-
Thanks, those are good suggestions. It provoked me into a quick "applocker registry" and "applocker wmi" search, which produced nothing. So I guess if there is a way, and there may not be, it will involve digging around the hard way and find a visible setting that Windows changes for AppLocker enforcement, just like you suggest.
-
This is tangentially an AutoIt question. AppLocker can run in "Audit only" mode or "Enforce rules" mode. I can't find any scriptable way to determine this setting. The Powershell AppLockerPolicy Cmdlets are for checking files and rules, but not AppLocker mode. Is there a Windows API call or something that can determine this?
-
I ended up writing a fairly simple "Watchdog" process. I needed this extra complexity because I have a bunch of communicating processes on a network. If something goes wrong, I want them all to shut down and also kill various other processes that have been started. The watchdogs start in either a "master" (for one) or "slave" (for the rest) mode, the slaves connect to the master and the master multicasts a message once a second. If things go silent for 20 seconds then the watchdogs kill everything.
-
Downloaded and found useful. Thanks.
-
How to select values in LIStBOX
clicked replied to nitesht's topic in AutoIt General Help and Support
There are a number of _GUICtrlListBox commands that you may find helpful. I have used these with success on list box controls in various applications. At first I was confused because it looked like it may only work for controls that AutoIt creates, but you can get the handle for any standard windows control. -
Controlling Windows Application by Autoit as a Service
clicked replied to Swarles's topic in AutoIt General Help and Support
I know Scheduled Tasks have a button called "Run Only When User is logged in", and this is necessary if you want the task to have any user interactions. I'm not sure if Services have that option. It may be that you need some indirection, e.g. run something as a service, which checks whether there is a console session, and if so, start an on-demand Scheduled Task to run a gui. -
This looks good, it may solve a problem for me. Thanks for posting.
- 4 replies
-
- update
- selfupdate
-
(and 2 more)
Tagged with:
-
FichteFoll has a very nice script, and I thank him. If anybody has trouble with it, as I did, the original Fiedl expression from his book seems to have a backslash before the G near the start of the expression. Once I put the backslash in, it worked great for me. (the google books link below may or may not take you to the exact page) http://books.google.com/books?id=sshKXlr32-AC&pg=PA213&lpg=PA213&dq=friedl+csv+regular+expression&source=bl&ots=d9O_1PafGi&sig=UuVi-teJFE1LDC82HnDg17yIj5Y&hl=en&sa=X&ei=NwckUOnIA8HlqgHR-YHQDA&ved=0CFQQ6AEwBA#v=onepage&q=friedl%20csv%20regular%20expression&f=false
-
There are probably scripts for scanning a folder, and certainly various scripts that do stuff with OCR packages (try searching on OCR or tesseract). You will still have much work to do e.g. download and install the OCR package, get the AutoIt OCR integration working, get a scanning loop going ... My experience with tesseract (a free OCR) is that it is not very good, but then I'm mostly working with technical displays with names like TESTOA004Z, and no OCR is going to do a good job on that.