Scriptor Posted January 30, 2007 Share Posted January 30, 2007 I have a problem. When I click on the file "Hello.test", when must open the program "Test.exe". How can I write this. The Program "Test.exe" must open all infos about "Hello.test" Link to comment Share on other sites More sharing options...
Shevilie Posted February 1, 2007 Share Posted February 1, 2007 Ehmm?? Can you try ro explain in other words, what you are trying to do ?? Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
TheCuz Posted February 1, 2007 Share Posted February 1, 2007 I have a problem. When I click on the file "Hello.test", when must open the program "Test.exe". How can I write this. The Program "Test.exe" must open all infos about "Hello.test"Are you asking how to associate a file with a .test extension with your test.exe program? [font="Verdana"]People who say it cannot be done should not interrupt those who are doing it. - George Benard Shaw[/font] Link to comment Share on other sites More sharing options...
Scriptor Posted February 1, 2007 Author Share Posted February 1, 2007 OK. The name of my programm is test.exe. The file for the program is hello.test. in the file hello.test you can find a sentence like this "Hello this is may test-program". Then I click on the file hello.test when start the program test.exe. When the program is active when the programm have to do read the sentence in the file hello.test and show it in a MsgBox Link to comment Share on other sites More sharing options...
someone Posted February 1, 2007 Share Posted February 1, 2007 (edited) Lets see if I understand fully what you want... you want to open a text file when it has a different extension? See if this is what you want... make a txt file, open it and put a some text in it, then rename it to test.hello and place in the same spot as your script(!important!) $file = FileOpen("test.hello", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf $var = FileRead($file) MsgBox(0, "Read...", $var) FileClose($file) If I am correct the extension of a file is there only to say how it should open. A text file is a text file with or without a .txt extension. Let us know if thats what you wanted. Edited February 1, 2007 by someone While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd Link to comment Share on other sites More sharing options...
Scriptor Posted February 8, 2007 Author Share Posted February 8, 2007 @someone: That isn't what I search. OK. You have a file. The filename is "Test.doc". When you click on this file, then start Word. And Word load the index of the file. I will programming this, too. When you click on the file "Hello.test", then start my programm "Test.exe". And this program must load the index of the file "Hello.test". Link to comment Share on other sites More sharing options...
xcal Posted February 8, 2007 Share Posted February 8, 2007 You want file association? ;Mhz ; _FiletypeAssociation('.test', 'test', 'notepad "%1"', 'test description') Func _FiletypeAssociation($extension, $type, $program, $description = '') ; e.g. _FiletypeAssociation('.pdf', 'FoxitReader.Document', '"%ProgramFiles%\FoxitReader.exe" "%1"') $exitcode = RunWait(@ComSpec & ' /c ftype ' & $type & '=' & $program & _ ' && assoc ' & $extension & '=' & $type, '', @SW_HIDE) If $description And Not $exitcode Then Return RegWrite('HKCR' & $type, '', 'Reg_sz', $description) EndIf Return Not $exitcode EndFunc How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
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