Sign in to follow this  
Followers 0
Radish

Possible to Create a Right-Click Context Menu Application Using AutoIt?

7 posts in this topic

I just changed from a WinXP system to a Win7 system. I have a program (available from SourceForge) called wxChecksums, it is no longer in development. Over the years I've found it invaluable. I installed this to Win7 and it works okay checking already created checksums files. However there was shell extension for this program (also at SourceForge) called wxChecksums Shell Extension, also no longer in development. I installed the extension to Win7 and found that it no longers works. This extension was invaluble for getting wxChecksums to quickly/automatically create 'sfv' and 'md5' checksum files by allowing right-click context menu items to be available in Windows  Explorer for creating a checksum file for any single file (or group of files) selected.

Now I'm wondering if I can make my own shell extension app using AutoIt. At this stage I just need some advice on if it is possible to do the following with AutoIt:

1) Make an app that will create, and allow Windows to use, right-click context menu items/selections?

2) Make an app that can be launched at system startup and that will not show an icon in the system tray for that app? (I'm really just wanting the app to run in the background so that is always there and correctly showing its options in the right-click context menus when a file(s) are right-clicked on.)

Hope the way I have described the above makes some sense. If you can see what I'm getting at and have any suggestions/comments of your own to make that aren't covered in my questions please do comment - maybe, conceptually I'm not got the right approach to this).


Operating System: Windows 7 Pro. x64 SP1

Share this post


Link to post
Share on other sites



Yes, all those right click contexts are just registry entries.

So create your installer for your script to write those registry values.

 

Yes again, put it in the all users startup folder, and put the #notrayicon flag in the script. 

 

The way I use right click contexts is that my script is not running, but rather you run it when you right click.

The most recent thing I made like this was a automatic resize program, this added a shift+right click on folders.  The registry location is different for right click on files.

#RequireAdmin

If FileExists("C:\Program Files (x86)\IrfanView\i_view32.exe") Then
$key = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
$val = "PATH"
$PATH = RegRead($key, $val)
$sAddThisPath = "C:\Program Files (x86)\IrfanView"
$PATH = $PATH & ";" & $sAddThisPath
RegWrite($key,$val,"REG_EXPAND_SZ",$PATH)
EnvUpdate()
ElseIf FileExists("C:\Program Files\IrfanView\i_view32.exe") Then
$key = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
$val = "PATH"
$PATH = RegRead($key, $val)
$sAddThisPath = "C:\Program Files\IrfanView"
$PATH = $PATH & ";" & $sAddThisPath
RegWrite($key,$val,"REG_EXPAND_SZ",$PATH)
EnvUpdate()
Else
    MsgBox(0, "Black Magic Automation", "Irfanview is not Detected, Install Aborted")
    Exit
EndIf
 
DirCreate("C:\IT Automation")
FileInstall("C:\My Places\Scripting\AutoIT\My Scripts\Context Menu Adding\RiskProcessReplace.bat", "C:\IT Automation\RiskProcessReplace.bat", 1)
FileInstall("C:\My Places\Scripting\AutoIT\My Scripts\Context Menu Adding\IV-INI\i_view32.ini", "C:\IT Automation\i_view32.ini", 1)
FileInstall("C:\My Places\Scripting\AutoIT\My Scripts\Context Menu Adding\BatchConvert.exe", "C:\IT Automation\BatchConvert.exe", 1)
RegWrite("HKEY_CLASSES_ROOT\Directory\shell\Auto Batch Convert")
RegWrite("HKEY_CLASSES_ROOT\Directory\shell\Auto Batch Convert", "", "REG_SZ", "Auto Batch Convert")
RegWrite("HKEY_CLASSES_ROOT\Directory\shell\Auto Batch Convert", "Extended", "REG_SZ", "")
RegWrite("HKEY_CLASSES_ROOT\Directory\shell\Auto Batch Convert", "Icon", "REG_SZ", '"C:\IT Automation\BatchConvert.exe"')
RegWrite("HKEY_CLASSES_ROOT\Directory\shell\Auto Batch Convert\command")
RegWrite("HKEY_CLASSES_ROOT\Directory\shell\Auto Batch Convert\command", "", "REG_SZ", 'C:\Windows\explorer.exe "C:\IT Automation\BatchConvert.exe"')
MsgBox(0, "Black Magic Automation", "Install is Completed, Shift Right Click Folders to use.")

Share this post


Link to post
Share on other sites

Thanks for the reply, Vicious.

The way I use right click contexts is that my script is not running, but rather you run it when you right click.

Yes! That is the way to go, thanks!

The most recent thing I made like this was a automatic resize program, this added a shift+right click on folders.  The registry location is different for right click on files.

Off the top of your head, would you know the registry locations for right click on files?

(I don't fully understand the script you posted just now, I'll have to study it very carefully - my experience of programming is slight. In any case as what I'm thinking of doing might be possible it looks like I have new project which will force me to learn more programming.)


Operating System: Windows 7 Pro. x64 SP1

Share this post


Link to post
Share on other sites

Off the top of my head no but its something close in the HCR registry and its a shell entry.

Some google will get you sorted, just search "add right click context registry"

As for my example above, most of it is not relivant so do not over examine it, the only part you want to look at is the RegWrite part for installing my AutoIT exe to the right click.

Share this post


Link to post
Share on other sites

Okay Vicious. Thanks very much!


Operating System: Windows 7 Pro. x64 SP1

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Okay Zedna, thanks! That's my study for later.

Edited by Radish
Got Zedna's name wrong first time.

Operating System: Windows 7 Pro. x64 SP1

Share this post


Link to post
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
Sign in to follow this  
Followers 0