Jump to content

Right Click on File


Recommended Posts

I am writing a script that will automate the update of an activex file for IE6. The manual way of doing this has been automated up to the point where I now need to right click on a file and select 'Update'

The steps are:

open IE

send !t (tools)

send !o (options)

send !s (ettings)

send !o (view objects)

and the next step (like I said) is to right click on the appropriate file and select 'update'

Any ideas?

Link to comment
Share on other sites

An alternative--but I don't like having to rely on Send at the very end.... There has to be another way like Larry suggested

DllCall("shell32.dll", "long", "ShellExecute", _
"hwnd", 0, "string", "", "string", @SystemDir & "\inetcpl.cpl",_
"string", "", "string", "", "long", @SW_SHOW)

WinWait("Internet Properties")
ControlClick("Internet Properties","","&Settings...")

WinWait("Settings")
ControlClick("Settings","","View &Objects...")

WinWait("Downloaded Program Files")

Send("s") ;This selects the "Shockwave Flash Object" on my system...
Send("{Apps}") ;Brings up the context menu
Send("u") ;chooses "update"
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

You could always use controllistview in the unstable...

<{POST_SNAPBACK}>

Im not sure what

controllistview

is but I am interested in learning. Icould find no reference in the help file.

Also, I just realized I am running V2 not 3 (my bad). Never the less, I am getting closer. The appskey command worked a charm. Now, how would I go about checking the file name of the currently selected file? For example one of the posts used send, s to select the shockwave activex, but if there is more than one file where the first letter is 's', how would I check the file name of the selected file to be sure I've got the right file?

(by the way, I really appreciate the help, you have gotten me much farther than I anticipated to be at this point)

Link to comment
Share on other sites

You really need to take the forward leap and install v3. That will make your life much easier. The syntax is a little different, but the usage is made much easier because of many extra enhancements. v2 does not have controllistview, but the beta version of autoit 3 does. If you download the new version, you will be able to make these types of scripts much faster and easier than with v2.

Edited by this-is-me
Who else would I be?
Link to comment
Share on other sites

You really need to take the forward leap and install v3. That will make your life much easier. The syntax is a little different, but the usage is made much easier because of many extra enhancements. v2 does not have controllistview, but the beta version of autoit 3 does. If you download the new version, you will be able to make these types of scripts much faster and easier than with v2.

<{POST_SNAPBACK}>

OK I am on V3 now (I like it!). BUT.... I still can't see an easy way to select a specific file. Even if I could step through file by file by sending the down arrow keystroke, I don't see anything that would work like a :

if SelectedFileName= "Whatever" then

Type of statement. Is there a way it can be done via the windows handle (of which I know little) :">

Link to comment
Share on other sites

To reiterate, if there is an option in the "right-click menu" then there should be an entry in the HKCU portion of the registry that describes the command line associated with that entry...

you would

$var = RegRead the HKCU default value entry for the extension ".ext"

Use that and RegRead HKCU\$var and RegRead the shell\update\command default entry to see how to formulate a command string...

I do this in my RunByAssoc function in the "Scripts and Scraps" forum. search the forum for "RunByAssoc".

I hope any of this helps you...

Lar.

<{POST_SNAPBACK}>

Two things here:

1) I did the search in scripts & scraps ... there was no posts found

2) The files in the downloaded Programs directory do not appear to have a standard file extension.

But I will keep looking. Thanks :)

Link to comment
Share on other sites

@larry, the downloaded program files folder is a non-file folder. It is like the temporary internet files folder. Therefore, you cannot update them using registry values because they don't exist. The contents of that folder are dynamically created at runtime. Therefore, visuallyimpaired, you will need to use ControlListView with the select command, and then send the appskey.

Who else would I be?
Link to comment
Share on other sites

@this-is-me

That is only partially true, there are files in that folder. They are NOT the ones that you see when you access the folder but they are there. They are not "dynamically" created either. They are graphical representations of registry values. These values are found:

HKLM\Software\Microsoft\Active Setup\Installed Components

HKLM\Software\Microsoft\Internet Explorer\Extensions

The second one is really more for toolbars than BHO's but they are there.

*** Matt @ MPCS

Link to comment
Share on other sites

Guys I dont understand why this has to be so hard. Why cant he just send a MouseClick() once to right click and then once to left click the update?

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Guys I dont understand why this has to be so hard. Why cant he just send a MouseClick() once to right click and then once to left click the update?

JS

<{POST_SNAPBACK}>

The problem is, everybody is getting stuck on "How can I make AutoIt automate this how I would do it." Larry is the only person thinking, "How can I make AutoIt do this like Windows?" Automating something how a user does it is, just like a user, very unreliable and prone to sudden, random and abrupt failure. Doing it like the OS does it behinds the scenes is infinitely more reliable, and very likely will be easier and require less code.

Edit: That is not to say that finding out how the system does it will be easier, just that the code implementation of that method will be easier.

Edited by Valik
Link to comment
Share on other sites

That is another reason I suggested opening the folder directly instead of going through internet explorer -> tools -> internet options.

@Matt, what I mean by "dynamically created" is that the files are not files. The view is dynamically created from the keys you mentioned. It is not read from a directory. We are relating the same information in different ways. What it boils down to is the fact that larry's assumption is wrong because there are no extenstions and no files being shown.

Edited by this-is-me
Who else would I be?
Link to comment
Share on other sites

Does anyone know exactly what happens when you do an update? That might be a better task to automate instead of automating telling windows to automate the action. What happens in the background?

@this-is-me: Sorry misunderstood your post. Thanks for not burning me.

*** Matt @ MPCS

Link to comment
Share on other sites

It seems to be an extension of explorer that is launching. I think the only main difference in the background is that the update feature looks at the cab version on the author's website to see if there is a newer version available. If so, it downloads it and installs it.

Who else would I be?
Link to comment
Share on other sites

The problem is, everybody is getting stuck on "How can I make AutoIt automate this how I would do it."  Larry is the only person thinking, "How can I make AutoIt do this like Windows?"  Automating something how a user does it is, just like a user, very unreliable and prone to sudden, random and abrupt failure.  Doing it like the OS does it behinds the scenes is infinitely more reliable, and very likely will be easier and require less code.

Edit: That is not to say that finding out how the system does it will be easier, just that the code implementation of that method will be easier.

<{POST_SNAPBACK}>

Thanks Valik you have a very valid point here. I appreciate that. This information now gives me the knowledge to be able to look at all the things I do in several lights.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

@Valik, same problem. There is no verb that runs a program, because it is not a file that is listed in that folder.

<{POST_SNAPBACK}>

There are also no files in the Network Connections "folder" but I'll be damned if I can't run verbs in VBScript on those.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...