jgq85
Active Members-
Posts
36 -
Joined
-
Last visited
Recent Profile Visitors
343 profile views
jgq85's Achievements
Seeker (1/7)
0
Reputation
-
Help putting a file in all users' "Startup" folder
jgq85 replied to jgq85's topic in AutoIt General Help and Support
On the help KB (https://www.autoitscript.com/autoit3/docs/functions/FileInstall.htm) the example is: FileInstall("C:\Test.bmp", @ScriptDir & "\Test.bmp") In my case isn't the Test.bmp my ITScript.exe ? Example uses C:\Test.bmp, not just "Test.bmp" -
Help putting a file in all users' "Startup" folder
jgq85 replied to jgq85's topic in AutoIt General Help and Support
Hi @1957classic, Thanks for the reply. I'm compiling the script to exe so does that mean I have to specify the path to the ITScript.exe on the machine I'm compiling from? So that it merges into the exe on the target system? -
I am trying both FileInstall and FileCopy. I can get it to work if I pick a folder anywhere else that exists, but for some reason if I try to make the path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp" or @StartupCommonDir, it doesn't create or copy the file there depending on what I try. The reason I need to put it here is because I can't run the exe i'm making in the user's context. My remote management tool will only run under the SYSTEM context. So I think this is the best way I can get it to the user's start up folder, as well as without triggering a UAC prompt. Anyone have advice? I've tried each of the following: FileInstall("C:\ITScript.exe", "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp", 1) FileInstall("C:\ITScript.exe", @StartupCommonDir, 1) FileCopy("C:\ITScript.exe", "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp") FileCopy("C:\ITScript.exe", @StartupCommonDir)
-
Hi, Thanks for that. Perhaps I shouldn't have tried to use a vague example, and my specific project here would have made things more clear. What I'm trying to do is create a phone number blocker for Microsoft Lync. I'm not familiar with the API (or any API in general) enough to make something advanced to block phone numbers and hang up on them, and as far as I know, there's no server-side feature in Lync 2010 to "block" phone numbers. So on the client end, I put this script together to check for when a new incoming call takes place (there is a window notification), and then it will click the "decline" button on the toast notification, thus ignoring (sort of blocking) the call. At this point, i have the following: Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase While 1 $FilePath = "C:\blockednumbers.txt" $FileRead = FileRead($FilePath ) $WindowName = StringSplit($FileRead , @CRLF, 1) For $i =1 To $WindowName[0] ControlClick("Phone Call from +1 " & $WindowName[$i],"","[CLASS:DirectUIHWND; INSTANCE:1]","",1,240,89) sleep(500) Next WEnd In C:blockednumbers.txt file, the phone numbers would have to be listed each line in this format: (123) 123-1234 So far, this appears to work just fine. My concern with ending a process is that Lync communicator would close entirely and would have to be re-opened. In my test I found that closing the window does not hang up the call. It hides the window but you continue to hear your phone ringing. By issuing a control click on the "Decline" mouse coordinates of the control, it hangs up the call. There doesn't appear to be anyway to click the "Decline" button outside of an x,y mouse coordinate controlclick.
-
Hi I'm looking to start a new (what I think will be simple) program. Basically I want to just have a text file that sits in a location, say, C:blockwindows.txt. For AutoIt I just want it to open and begin auto-closing any windows that contain the string that is put in each line within that c:blockwindows.txt. So the C:blockwindows.txt may contain these strings "some string here test" "another string here" "yet another string". So what AutoIt would do, is constantly be monitoring for any openings of windows on the computer that contains any of those strings, whether it's at the beginning or end or whereever in the Window title. These windows could open up at any time of the day. Here's what I've got so far from research, just having a challenge determining whether it's the right approach, and ultimately, figuring out how to piece it together. - I do not know what window MatchMode to use based on the strings read from the text file to determine if the string matches that of what's in the title. I could make an exact match given that I do know what prefix and suffix comes before/after the string variable if needed. $FilePath = "C:blockedwindows.txt" $FileRead = FileRead($FilePath ) $WindowName = StringSplit($FileRead , @CRLF, 1) For $i =1 To $WindowName[0] WinClose ($WindowName[$i]) Next Something like this could work I'm just worried about CPU usage. It goes about 25% of the CPU. But if I add a sleep(1000) after WinClose, it remains at 0% CPU.
-
I am trying to get a simple program to move this one particular window on the screen. It works, but the window moves itself back about a second later. WinMove("[CLASS:OCAppSharingBackdropControls]", "", 233, 233, 900, 36) I've tried pasting the same line over and over but it doesn't "keep" it moved. Tried adding in sleeps and pasting over and over, but it only moves it a few times and would actually make the window difficult to then interact with. Not sure if it matters to share but the details on this window is that it is a toolbar that shows at the top of a user's monitor when Lync/Communicator is open and they are sharing their screen. I'm guessing there is some built-in mechanism in place in Lync to move this toolbar/window back to its default position of 233,0,900,36. Is there anyway for AutoIt to override this? I'd rather not corrupt memory on the client side of things if possible. Also the idea of this program is that when they're sharing their screen, and I click "Request Control" on my end to assist them with an issue, then the typical user is not oblivious to the fact I'm requesting control since the toolbar is at the top of the screen prompting them, where 90% of the time they never notice it (very frustrating). This way the window would be moved to the middle of the screen.
-
Hi I have a question regarding arrays as I'm still trying to grasp the concept. Over at http://www.autoitscript.com/wiki/Arrays, it states you have to do a -1 to get the actual index (since computer counts starting at 0) So its example: Local $arr[3] = ["element 1", "element 2", "element 3"] For $i = 0 to 3 - 1 ; We have an array with three elements but the last index is two. ConsoleWrite($arr[$i] & @LF) Next My question is, why wouldn't you just change "For $i = 0 to 3 -1" to "For $i = 0 to 2"?
-
Need help with WinList, Array and Variables
jgq85 replied to jgq85's topic in AutoIt General Help and Support
Thanks. Well I'm trying to use the concept here and apply it to Instant Message windows in another program, so there would be no files. But I guess what you're saying is that you'd keep an array of open Windows, and any new windows introduced that aren't part of the existing array, will be dealt with then added into the existing array. right? -
Hi I'm still kind of new here, I'm trying to figure out how to do the following with a script. Does anyone know which code/technique could be used for accomplishing this, because I cannot figure it out. 1. First check for all open Notepad windows and send text into each one - this one I can do by using the below and a ControlSend: #include <Array.au3> $List = WinList("[CLASS:Notepad]") For $item = 1 To ($List[0][0]) $Value = $List[$item][0] Next 2. However I want to be able to check for any NEW notepad documents that open with a new title and when it detects a new notepad file is open, it will do ControlSend to that one as well. Then continue to send text into each new Notepad file I open, without repeatedly sending the text to any open notepad windows I've already had it send text to
-
Check status co-worker in communicator 2007
jgq85 replied to waardd's topic in AutoIt General Help and Support
Where did you get the info for the _GetStatusName function? was that from here? http://msdn.microsoft.com/en-us/library/bb787207(v=office.12).aspx Or did you check somewhere locally? I'm trying to check locally if possible -
Did you refer here for the Status indications? MISTATUS Enumeration - http://msdn.microsoft.com/en-us/library/ff801821(v=vs.85).aspx Or did you gather that info elsewhere?
-
ok, I think I found where it is in OLE/COM Object Viewer Under Object Classes > Grouped by Component Category > Automation Objects > then "Office Communicator Messenger Class". Now the documentation and script example is starting to make sense (to me as a newb). As I Now see the "Communicator.UIAutomation" value for VersionIndependentProgID. Verified presence of TypeLib Then in ITypeInfoViewer, I see the GetContact information. Still a little confusing but at least I'm farther than where I was before.
-
For hours been searching "Communicator.UIAutomation" all over Google, have no idea where it comes from still. Found some website in spanish that had a screenshot of the Registry, where I do show show it in HKEY_CLASSES_ROOTCommunicator.UIAutomation Still not sure how/why AutoIt works or how you'd come to find out about Communicator.UIAutomation for ObjCreate
-
I guess what I'm trying to do is find where the Object exists in my system. In the code it's ObjCreate("Communicator.UIAutomation") But I'm using OLE/COM Object Viewer, from C:Program Files (x86)Windows Kits8.0binx86 Because the download link in that ComRef.htm KB article is invalid, probably because it's a Windows 2000 resource kit download out of date. And I'm not sure where within Object Viewer the Communicator one is. There's no search feature unfortunately.