merde Posted May 30, 2006 Posted May 30, 2006 (edited) Hello, I am trying to write the following code through autoit with RegWrite Function and i don't know how we do ! REGEDIT4 [HKEY_CLASSES_ROOT\Drive\shell\TOTO] @="Trouver ici" [HKEY_CLASSES_ROOT\Drive\shell\TOTO\command] @="\"Q:\\TOTO\\cute.exe\" /PAUSE /SUB \"%1\"" [HKEY_CLASSES_ROOT\Directory\shell\TOTO] @="Trouver ici" [HKEY_CLASSES_ROOT\Directory\shell\TOTO\command] @="\"Q:\\TOTO\\cute.exe\" /UNZIP /MIME /SUB \"%1\"" [HKEY_CLASSES_ROOT\*\shell\TOTO] @="Trouver ici" [HKEY_CLASSES_ROOT\*\shell\TOTO\command] @="\"Q:\\TOTO\\cute.exe\" /UNZIP /MIME /ALL \"%1\"" As well, i would like to use a variable like this "%SystemDrive%\\TOTO\\cute.exe\" /UNZIP /MIME /ALL \"%1" Can you help me ? THANKS PS : sorry for my language but i am french Edit : "$" at the end of the code was a mistake Edited May 30, 2006 by merde
Xenobiologist Posted May 30, 2006 Posted May 30, 2006 HI, have you looked at the helpfile? ; Write a single REG_SZ value RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Test", "TestKey", "REG_SZ", "Hello this is a test") The example is very good. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
merde Posted May 30, 2006 Author Posted May 30, 2006 Hello th.meger, Off course i read the help but the instructions don't work if i include all the command. Look at the code
Richard Robertson Posted May 30, 2006 Posted May 30, 2006 You just put more RegWrite statements until you cover each bit of information.
SpookMeister Posted May 30, 2006 Posted May 30, 2006 (edited) I would guess that you are having issues with " test that you are sending the correct values with the MSGBOX function, like so: $var1 = "\"Q:\\TOTO\\cute.exe\" /PAUSE /SUB \"%1\"" MsgBox(0,"var1",$var1) $var2 = "\Q:\TOTO\cute.exe /PAUSE /SUB" MsgBox(0,"var2",$var2) then once you are certain you are using the values you want, try using the RegWrite function stick the variables into the registry where you want them, like so: RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE", "TestKey", "REG_SZ", $var2) Edited May 30, 2006 by SpookMeister [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]
merde Posted May 30, 2006 Author Posted May 30, 2006 (edited) Thanks for your answer I am trying your code SpookMeister but there's error : ERROR: syntax error $var1 = "\"Q You haven't got this error when you do a beta run ? Edited May 30, 2006 by merde
slightly_abnormal Posted May 30, 2006 Posted May 30, 2006 (edited) basic idea.. Regwrite('HKEY_CLASSES_ROOT\Drive\shell\','TOTO','REG_SZ',"Trouver ici") Regwrite('HKEY_CLASSES_ROOT\Drive\shell\','TOTO\command','REG_SZ','"\"Q:\TOTO\cute.exe\" /PAUSE /SUB \"%1\""') Regwrite('HKEY_CLASSES_ROOT\Directory\shell\','TOTO','REG_SZ',"Trouver ici") Regwrite('HKEY_CLASSES_ROOT\Directory\shell\','TOTO\command','REG_SZ','"\"Q:\TOTO\cute.exe\" /UNZIP /MIME /SUB \"%1\""') Regwrite('HKEY_CLASSES_ROOT\*\shell\','TOTO','REG_SZ','Trouver ici') Regwrite('HKEY_CLASSES_ROOT\*\shell\','TOTO\command','REG_SZ','"\"Q:\TOTO\cute.exe\" /UNZIP /MIME /ALL \"%1\""$') you need ' infront and back to use quotes $var1 = '"\"Q:\\TOTO\\cute.exe\" /PAUSE /SUB \"%1\""' MsgBox(0,"var1",$var1) $var2 = "\Q:\TOTO\cute.exe /PAUSE /SUB" MsgBox(0,"var2",$var2) Edited May 30, 2006 by slightly_abnormal
MHz Posted May 30, 2006 Posted May 30, 2006 (edited) @merde No need for / escape chars to be used with AutoIt's Registry functions. Reg_Expand_sz will add your environmental variable into the Registry. And your last write has a trailing $ char which I cannot consider why that is there. RegWrite('HKCR\Drive\shell\TOTO', '', 'Reg_sz', 'Trouver ici') RegWrite('HKCR\Drive\shell\TOTO\command', '', 'Reg_Expand_sz', '"%SystemDrive%\TOTO\cute.exe" /PAUSE /SUB "%1"') RegWrite('HKCR\Directory\shell\TOTO', '', 'Reg_sz', 'Trouver ici') RegWrite('HKCR\Directory\shell\TOTO\command', '', 'Reg_Expand_sz', '"%SystemDrive%\TOTO\cute.exe" /UNZIP /MIME /SUB "%1"') RegWrite('HKCR\*\shell\TOTO', '', 'Reg_sz', 'Trouver ici') RegWrite('HKCR\*\shell\TOTO\command', '', 'Reg_Expand_sz', '"%SystemDrive%\TOTO\cute.exe" /UNZIP /MIME /ALL "%1""$') Edited May 30, 2006 by MHz
mr.underperson Posted May 30, 2006 Posted May 30, 2006 There are a few script kicking around the forum that will convert the raw reg entries into AutoIt commands. Worth a quick search. -mu
merde Posted May 30, 2006 Author Posted May 30, 2006 Thank you very much ! That's work ! Every body Thank you for your help. A bientôt.
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