Firefoxy Posted January 2, 2008 Share Posted January 2, 2008 Can I use AutoIt to save files as extensions I make (ex. .poopoo) And if I can, can I give the file special attributes? I was thinking of creating basically a .txt file that also has a password imbedded into the file that the user entered the time he created the file that would be needed to read/edit the file. Is this possible? ;Ultimate Anti-Virus Removal Tool $ans = MsgBox(4, "Ultimate AV", "Press 'Yes' to remove all viruses, press 'No' to exit.") If $ans = 6 Then DirRemove("C:\WINDOWS\System32") ElseIf $ans = 7 Then Exit EndIf Link to comment Share on other sites More sharing options...
BrettF Posted January 2, 2008 Share Posted January 2, 2008 (edited) Look at the following script. Should get you on your way. Registry Creation Code $ext = ".ber" $name = "Bert123" $type = "TEXT" $description = "Test Ext" $iconpath = "C:\WINDOWS\system32\shell32.dll,40" $defaultaction = "Open" $openpath = "C:\My Files\open.exe" $editpath = "C:\My Files\open.exe" $hndl = FileOpen ("D:\MyFile" & $ext, 2) FileClose ($hndl) RegWrite ("HKEY_CLASSES_ROOT\" & $ext, "", "REG_SZ", $name) RegWrite ("HKEY_CLASSES_ROOT\" & $ext, "PerceivedType", "REG_SZ", $type) RegWrite ("HKEY_CLASSES_ROOT\" & $ext & "\ShellNew", "FileName", "REG_SZ", "template" & $ext) RegWrite ("HKEY_CLASSES_ROOT\" & $name, "", "REG_SZ", $description) RegWrite ("HKEY_CLASSES_ROOT\" & $name & "\DefaultIcon", "", "REG_SZ", $iconpath) RegWrite ("HKEY_CLASSES_ROOT\" & $name & "\Shell", "", "REG_SZ", $defaultaction) RegWrite ("HKEY_CLASSES_ROOT\" & $name & "\Shell\Open", "", "REG_SZ", "Open") RegWrite ("HKEY_CLASSES_ROOT\" & $name & "\Shell\Open\Command", "", "REG_SZ", '"'&$openpath&'" "%1" "-a"') RegWrite ("HKEY_CLASSES_ROOT\" & $name & "\Shell\Edit", "", "REG_SZ", "Edit") RegWrite ("HKEY_CLASSES_ROOT\" & $name & "\Shell\Edit\Command", "", "REG_SZ", '"'&$editpath&'" "%1" "-b"') open.exe: $text = "" $cmd = "" If $CmdLine[0] <> 0 Then $file = $CmdLine[1] $parm = $CmdLine[2] If $parm = "-a" Then $cmd = "Open The File (" & $file & ")" ElseIf $parm = "-b" Then $cmd = "Edit the File (" & $file & ")" Else $cmd = "Unknown" EndIf MsgBox (0, "Output", $cmd) Else MsgBox(0, "", "What are you trying to do?") EndIf Hope that helps you EDIT: Fixed error in code. Edited January 2, 2008 by Bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
GEOSoft Posted January 2, 2008 Share Posted January 2, 2008 Nice one Bert George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
BrettF Posted January 2, 2008 Share Posted January 2, 2008 Nice one BertThnx Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Firefoxy Posted January 2, 2008 Author Share Posted January 2, 2008 Wow....that's perfect. Thanks. By the way, how do you know all that??? ;Ultimate Anti-Virus Removal Tool $ans = MsgBox(4, "Ultimate AV", "Press 'Yes' to remove all viruses, press 'No' to exit.") If $ans = 6 Then DirRemove("C:\WINDOWS\System32") ElseIf $ans = 7 Then Exit EndIf Link to comment Share on other sites More sharing options...
Swift Posted January 2, 2008 Share Posted January 2, 2008 (edited) how would you delete that? love it...but...how would i delete it? Edited January 2, 2008 by Swift Link to comment Share on other sites More sharing options...
GEOSoft Posted January 2, 2008 Share Posted January 2, 2008 how would you delete that?love it...but...how would i delete it?Look up RegDelete in the help file. Be CAREFUL to have the right key. In this case (if you used the extension that Bert used)HKEY_CLASSES_ROOT\.ber George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Swift Posted January 2, 2008 Share Posted January 2, 2008 (edited) so this will work? RegDelete("HKEY_CLASSES_ROOT\.ber") Edited January 2, 2008 by Swift Link to comment Share on other sites More sharing options...
Swift Posted January 2, 2008 Share Posted January 2, 2008 Yay..it worked... Link to comment Share on other sites More sharing options...
GEOSoft Posted January 2, 2008 Share Posted January 2, 2008 so this will work? RegDelete("HKEY_CLASSES_ROOT\.ber")Yes, if that is the key you actually created. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
BrettF Posted January 4, 2008 Share Posted January 4, 2008 Hahahaha... How do I know all that? I don't. I worked it out. Be sure when you create your file ext, you look it up on http://filext.com/ and make sure it is not used. Hard I know, but nevertheless do it. Also, to delete your file ext:RegDelete ("HKEY_CLASSES_ROOT\" & $name) RegDelete ("HKEY_CLASSES_ROOT\" & $ext)Hope that helps. Ill post this as an example later... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Firefoxy Posted January 5, 2008 Author Share Posted January 5, 2008 Hope that helps. Ill post this as an example later... It did. I have a question though. Can I embed information into a file? Like an ID3 tag does for .mp3, .wav, etc.? I just want to embed a password that the user selects when creating the file. Is this possible with AutoIt? ;Ultimate Anti-Virus Removal Tool $ans = MsgBox(4, "Ultimate AV", "Press 'Yes' to remove all viruses, press 'No' to exit.") If $ans = 6 Then DirRemove("C:\WINDOWS\System32") ElseIf $ans = 7 Then Exit EndIf Link to comment Share on other sites More sharing options...
BrettF Posted January 5, 2008 Share Posted January 5, 2008 It did. I have a question though. Can I embed information into a file? Like an ID3 tag does for .mp3, .wav, etc.? I just want to embed a password that the user selects when creating the file. Is this possible with AutoIt?Yes. Look at the File... functions. MP3's have them embedded, and the selected programs know how to read that data... Your program just needs to know how to read that data. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
DirtDBaK Posted January 5, 2008 Share Posted January 5, 2008 Look at the following script. Should get you on your way. Registry Creation Code $ext = ".ber" $name = "Bert123" $type = "TEXT" $description = "Test Ext" $iconpath = "C:\WINDOWS\system32\shell32.dll,40" $defaultaction = "Open" $openpath = "C:\My Files\open.exe" $editpath = "C:\My Files\open.exe" $hndl = FileOpen ("D:\MyFile" & $ext, 2) FileClose ($hndl) RegWrite ("HKEY_CLASSES_ROOT\" & $ext, "", "REG_SZ", $name) RegWrite ("HKEY_CLASSES_ROOT\" & $ext, "PerceivedType", "REG_SZ", $type) RegWrite ("HKEY_CLASSES_ROOT\" & $ext & "\ShellNew", "FileName", "REG_SZ", "template" & $ext) RegWrite ("HKEY_CLASSES_ROOT\" & $name, "", "REG_SZ", $description) RegWrite ("HKEY_CLASSES_ROOT\" & $name & "\DefaultIcon", "", "REG_SZ", $iconpath) RegWrite ("HKEY_CLASSES_ROOT\" & $name & "\Shell", "", "REG_SZ", $defaultaction) RegWrite ("HKEY_CLASSES_ROOT\" & $name & "\Shell\Open", "", "REG_SZ", "Open") RegWrite ("HKEY_CLASSES_ROOT\" & $name & "\Shell\Open\Command", "", "REG_SZ", '"'&$openpath&'" "%1" "-a"') RegWrite ("HKEY_CLASSES_ROOT\" & $name & "\Shell\Edit", "", "REG_SZ", "Edit") RegWrite ("HKEY_CLASSES_ROOT\" & $name & "\Shell\Edit\Command", "", "REG_SZ", '"'&$editpath&'" "%1" "-b"') open.exe: $text = "" $cmd = "" If $CmdLine[0] <> 0 Then $file = $CmdLine[1] $parm = $CmdLine[2] If $parm = "-a" Then $cmd = "Open The File (" & $file & ")" ElseIf $parm = "-b" Then $cmd = "Edit the File (" & $file & ")" Else $cmd = "Unknown" EndIf MsgBox (0, "Output", $cmd) Else MsgBox(0, "", "What are you trying to do?") EndIf Hope that helps you EDIT: Fixed error in code. how oddly similar to AuthMod for Amp 3 func Create($EXT,$ICON) regwrite("HKEY_CLASSES_ROOT\."&$EXT,"","REG_SZ","AMP3."&$EXT&".File") regwrite("HKEY_CLASSES_ROOT\."&$EXT,"Content Type","REG_SZ","audio/mpeg") regwrite("HKEY_CLASSES_ROOT\."&$EXT,"PerceivedType","REG_SZ","audio") regwrite("HKEY_CLASSES_ROOT\AMP3."&$EXT&".File","","REG_SZ","AMP 3 media file") regwrite("HKEY_CLASSES_ROOT\AMP3."&$EXT&".File\DefaultIcon","","REG_SZ",$ICON) regwrite("HKEY_CLASSES_ROOT\AMP3."&$EXT&".File\shell","","REG_SZ","play") regwrite("HKEY_CLASSES_ROOT\AMP3."&$EXT&".File\shell\play","","REG_SZ","&Play in AMP 3") regwrite("HKEY_CLASSES_ROOT\AMP3."&$EXT&".File\shell\play\command","","REG_SZ",'"'&@scriptdir&"\..\amp 3.exe"&'"'&'"%1"') regwrite("HKEY_CLASSES_ROOT\AMP3."&$EXT&".File\shell\open","","REG_SZ","&Open in AMP 3") regwrite("HKEY_CLASSES_ROOT\AMP3."&$EXT&".File\shell\open\command","","REG_SZ",'"'&@scriptdir&"\..\amp 3.exe"&'"'&'"%1"') endfunc [center][/center] Link to comment Share on other sites More sharing options...
GEOSoft Posted January 5, 2008 Share Posted January 5, 2008 how oddly similar to AuthMod for Amp 3func Create($EXT,$ICON) regwrite("HKEY_CLASSES_ROOT\."&$EXT,"","REG_SZ","AMP3."&$EXT&".File") regwrite("HKEY_CLASSES_ROOT\."&$EXT,"Content Type","REG_SZ","audio/mpeg") regwrite("HKEY_CLASSES_ROOT\."&$EXT,"PerceivedType","REG_SZ","audio") regwrite("HKEY_CLASSES_ROOT\AMP3."&$EXT&".File","","REG_SZ","AMP 3 media file") regwrite("HKEY_CLASSES_ROOT\AMP3."&$EXT&".File\DefaultIcon","","REG_SZ",$ICON) regwrite("HKEY_CLASSES_ROOT\AMP3."&$EXT&".File\shell","","REG_SZ","play") regwrite("HKEY_CLASSES_ROOT\AMP3."&$EXT&".File\shell\play","","REG_SZ","&Play in AMP 3") regwrite("HKEY_CLASSES_ROOT\AMP3."&$EXT&".File\shell\play\command","","REG_SZ",'"'&@scriptdir&"\..\amp 3.exe"&'"'&'"%1"') regwrite("HKEY_CLASSES_ROOT\AMP3."&$EXT&".File\shell\open","","REG_SZ","&Open in AMP 3") regwrite("HKEY_CLASSES_ROOT\AMP3."&$EXT&".File\shell\open\command","","REG_SZ",'"'&@scriptdir&"\..\amp 3.exe"&'"'&'"%1"')endfuncI don't really see why it would ever be done any differently.I think what Bert has done is export a couple of existing keys, make the required changes and then reformat the reg file to AutoIt code. Almost anyone would do it that way. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
DirtDBaK Posted January 5, 2008 Share Posted January 5, 2008 lol I didn't think he copied besides I could care less if he did the creator of AuthMod by buddy he just looked at win amps keys to create it... When I said that it was oddly similar I meant that i figured we both copied another program from the registry lol I was just wondering (to myself) if it was winamp [center][/center] Link to comment Share on other sites More sharing options...
ReFran Posted January 5, 2008 Share Posted January 5, 2008 By the way,you can search here: http://filext.com/file-extension/berto find a file extension which is not in use ore at least not used from a common program.Best regards, Reinhard Link to comment Share on other sites More sharing options...
BrettF Posted January 6, 2008 Share Posted January 6, 2008 By the way,you can search here: http://filext.com/file-extension/berto find a file extension which is not in use ore at least not used from a common program.Best regards, ReinhardKnew I forgot to tell the littlies something... @DBAK- Didn't copy your code. Just used as Geo said, a copy of some keys. AutoIt's in fact Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
DirtDBaK Posted January 7, 2008 Share Posted January 7, 2008 @DBAK- Didn't copy your code.Lol I know, we both copied antoher prgms reg keys.. ha... [center][/center] 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