Miloud Posted March 23, 2017 Posted March 23, 2017 Hi, I have associated a file extension "tcr" with my application using this script which I found on stackOverFlow FileExtAssoc("tcr", "C:\Users\HP\Desktop\crypt\cryptIt.exe") func FileExtAssoc($sExt, $sApplication) RunWait(@COMSPEC & " /c ASSOC ." & $sExt & "=ExTest", "", @SW_HIDE) RunWait(@COMSPEC & " /c FTYPE ExTest=" & $sApplication , "", @SW_HIDE) MsgBox(0,"File Extension Application Association",'"' & $sExt & '"is now asscoiated with "' & $sApplication & '"',3) EndFunc on my application: #include <Array.au3> #include <WinAPIShPath.au3> ; An alternative to the limitation of $CmdLine[] only being able to return a maximum of 63 parameters. Local $aCmdLine = _WinAPI_CommandLineToArgv($CmdLineRaw) _ArrayDisplay($aCmdLine) $t="" For $i=1 To $CmdLine[0] $t &=$CmdLine[$i] &@CRLF Next ClipPut($t) I want to get the path after running "myfile.tcr". Using the above script, it's possible if I drag the mouse over the file "myfile.tcr" and drop it on my my application... I want that to happen when I double click. Any suggestions please!
Danyfirex Posted March 23, 2017 Posted March 23, 2017 Hello. This may help. http://stackoverflow.com/questions/69761/how-to-associate-a-file-extension-to-the-current-executable-in-c-sharp Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
Miloud Posted March 23, 2017 Author Posted March 23, 2017 25 minutes ago, Danyfirex said: Hello. This may help. http://stackoverflow.com/questions/69761/how-to-associate-a-file-extension-to-the-current-executable-in-c-sharp Saludos I appreciate your help... The discussion on that page is far beyond my level...
Miloud Posted March 23, 2017 Author Posted March 23, 2017 (edited) Thank to: https://commandwindows.com/assoc.htm The solution is to add " %1" to the 5th line of the association script: FileExtAssoc("tcr0", "C:\Users\HP\Desktop\crypt\cryptIt.exe") Func FileExtAssoc($sExt, $sApplication) RunWait(@COMSPEC & " /c ASSOC ." & $sExt & "=ExTest", "", @SW_HIDE) RunWait(@COMSPEC & " /c FTYPE ExTest=" & $sApplication & ' "%1"', "", @SW_HIDE) MsgBox(0,"File Extension Application Association",'"' & $sExt & '"is now asscoiated with "' & $sApplication & '"',3) EndFunc Edited March 25, 2017 by Miloud Ammending the code I provided Danyfirex 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now