Jump to content
DynamicRookie

[FIXED] Assign a file type to be opened with an AutoIt Program

Recommended Posts

DynamicRookie

Hey there!

 

Basic question :blink:

 

I need to create a registry key to assign an option to windows file context menu, so the file can be opened with an AutoIt program i made, and let the program know it was opened with a link instead of running it normally.

 

Thanks in advance :D

Share this post


Link to post
Share on other sites
FrancescoDiMuro

Something like this? :)

 

Best Regards.


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
DynamicRookie
  • How i send the file path by registry keys
  • How i assign the file type to be opened with my app that is not in any of the windows directories

Share this post


Link to post
Share on other sites
FrancescoDiMuro

What did you try by now so far? :)

We can't help you if we can't see what did you now by now :)


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
DynamicRookie
1 minute ago, FrancescoDiMuro said:

What did you try by now so far? :)

We can't help you if we can't see what did you now by now :)

Yes you can help me, is not coding something, i just need to know how to use RegEdit and CmdLine with windows file context menu

 

And i haven't seen anything in helpfile.

Share this post


Link to post
Share on other sites
FrancescoDiMuro
1 minute ago, DynamicRookie said:

Yes you can help me

I hope so, but you need to provide some work. I am giving to you everything you need to do what you are trying to do.

2 minutes ago, DynamicRookie said:

i just need to know how to use RegEdit and CmdLine with windows file context menu

 

And i haven't seen anything in helpfile.

Don't you see anything about Reg* functions in the Help file? Or Run, ShellExecute, @ComSpec ? :)


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
DynamicRookie
#include "FastFind.au3"
#include <File.au3>
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
$n = 'testimg.pcs'
$idata = ''
$overlim = False
$image = FileReadToArray('testimg.pcs')
For $i = 1 To UBound($image) - 1
    $idata &= $image[$i] & @CRLF
Next
$imagedata = StringSplit($idata, '|')
$idim = FileReadLine('testimg.pcs', 1)
$dims = StringSplit($idim, ' ')
$img = GUICreate('Mapping', 1, 1, -1, -1, BitOR($WS_VSCROLL, $WS_HSCROLL))
GUISetState(@SW_SHOW, $img)
$Map = WinWaitActive('Mapping')
$loop = 1
MsgBox(0, '', 'Mapping starts now')
__ImageMapping($imagedata)
Sleep(5000)

Func __ImageMapping(ByRef $data)
    FFSnapshot(0, 0, $dims[1]-1, $dims[2]-1)
    $pixelnum = 0
    For $y = 1 To $dims[2]
        For $x = 1 To $dims[1]
            If $loop = 1 Or $loop < 1 Then
            $pixelnum += 1
            $loop = 1
            Else
                $loop -= 1
            EndIf
            $idim = FileReadLine('testimg.pcs', 1)
            $dims = StringSplit($idim, ' ')
;~          SplashTextOn('', $pixelnum & '[' & $loop, 100, 100, 100, 100)
            If $pixelnum > $data[0] Then
                $overlim = True
                ExitLoop
            EndIf
            If StringInStr($data[$pixelnum], '-') <> 0 And $loop = 1 Or $loop < 1 Then
                $loop = 1
                $split = StringSplit($data[$pixelnum], '-')
                $loop = $split[2]
                $data[$pixelnum] = StringTrimRight($data[$pixelnum], StringLen($split[2])+1)
            EndIf
            If $data[$pixelnum] <> '/' Then
                FFSetPixel($x-1, $y-1, '0x' & StringTrimLeft(Hex($data[$pixelnum]), 2))
;~          Dim $GraphicalArray[$dims[1]*2][$dims[2]*2]
;~          $GraphicalArray[$x - 1][$y - 1] = GUICtrlCreateGraphic($x, $y, 2, 2)
;~          GUICtrlSetGraphic(-1, $GUI_GR_DOT)
;~          GUICtrlSetBkColor(-1, Hex($data[$pixelnum - 1]))
                WinSetTitle($map, '', '0x' & StringTrimLeft(Hex($data[$pixelnum]), 2))
            EndIf
        Next
        If $overlim = True then ExitLoop
    Next
    FFSaveJPG('MappedImg', $dims[1] + $dims[2], False)
EndFunc   ;==>__ImageMapping

 

Share this post


Link to post
Share on other sites
DynamicRookie
29 minutes ago, FrancescoDiMuro said:

Don't you see anything about Reg* functions in the Help file? Or Run, ShellExecute, @ComSpec ? :)

That has nothing to do with my question, i dont want to execute anything, i want to open a file with an autoit script

Share this post


Link to post
Share on other sites
DynamicRookie

Like if i wanted to open an audio file with Windows Media

Share this post


Link to post
Share on other sites
DynamicRookie

Fixed:

When a file is opened with context menu, CmdLineRaw will be equal to the filepath of the file that called program.

Only remove quotes and assign the path to a variable

Hope someone finds this useful

Share this post


Link to post
Share on other sites
careca

Because you mentioned context menu (i assume windows context menu?) then it is logical that you would need to use the registry to place the necessary entries that will point to the application in cause. So in effect, in the command part of the registry, you can add the variable and the command that passes to the autoit application, something like:

autoitapp.exe /open %1

Then in the application itself, instead of cmdlineraw, you check the first cmdline for "/open" and then the second one will be the file.

This is how i did my context menus, not sure how you do it otherwise.


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

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

×