AlmarM Posted September 30, 2008 Posted September 30, 2008 (edited) Hello, I made this simple RegWrite example. expandcollapse popupIf IsAdmin() Then MsgBox(64, "Succes", "Admin rights detected! You can safely use the program.") Else MsgBox(16, "ERROR", "No Admin rights detected! Program will exit now!") Exit EndIf $GUI = GUICreate("iRun - Make programs run at windows start!", 260, 145, -1, -1) GUICtrlCreateLabel("Select the file that sould be started at windows start.", 10, 10) $Input1 = GUICtrlCreateInput("", 10, 30, 215) $Button1 = GUICtrlCreateButton("...", 230, 28, 25, 23) $Radio1 = GUICtrlCreateRadio("Always", 10, 60) $Radio2 = GUICtrlCreateRadio("Only on this account", 10, 80) $Button2 = GUICtrlCreateButton("Go!", 10, 110, 100) GUICtrlSetState($Radio1, 1) GUISetState() While 1 $nMsg = GUIGetMsg() Select Case $nMsg = -3 Exit Case $nMsg = $Button1 $fod = FileOpenDialog("Select your file", @DesktopDir, "All Files (*.*)") If @error = 1 Then Else GUICtrlSetData($Input1, $fod) EndIf Case $nMsg = $Button2 $Read_Radio1 = GUICtrlRead($Radio1) $Read_Input1 = GUICtrlRead($Input1) If $Read_Radio1 = 1 Then RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", @UserName & " Run", "REG_SZ", $Read_Input1) Else RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", @UserName & " Run", "REG_SZ", $Read_Input1) EndIf MsgBox(0, "", "File added!") EndSelect WEnd Actualy, I was bored AlmarM Edited October 1, 2008 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.
gseller Posted September 30, 2008 Posted September 30, 2008 Nice idea! Alot of folks don't know how to set this up.. Will be helpful to many..
trancexx Posted September 30, 2008 Posted September 30, 2008 You cannot write to HKLM on Vista unless having full administrator rights. ♡♡♡ . eMyvnE
TehWhale Posted September 30, 2008 Posted September 30, 2008 trancexx said: You cannot write to HKLM on Vista unless having full administrator rights.You can't edit any of the registry on vista for that matter.
trancexx Posted September 30, 2008 Posted September 30, 2008 SwiftBurns said: You can't edit any of the registry on vista for that matter.Not even under HKCU? ♡♡♡ . eMyvnE
AlmarM Posted October 1, 2008 Author Posted October 1, 2008 Easy to fix this... Check my first post again! AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.
trancexx Posted October 1, 2008 Posted October 1, 2008 AlmarM said: Easy to fix this... Check my first post again! AlmarMThat's not fix. Fix would be using keyword: #RequireAdmin @SwiftBurns; you can do what ever you want with HKEY_CURRENT_USER on Vista. If using keyword #RequireAdmin in your script you have ability to do the same thing with HKEY_CLASSES_ROOT or HKEY_CURRENT_CONFIG and not fully everything with HKEY_LOCAL_MACHINE and HKEY_USERS. ♡♡♡ . eMyvnE
AlmarM Posted October 1, 2008 Author Posted October 1, 2008 trancexx said: That's not fix. Fix would be using keyword: #RequireAdmin @SwiftBurns; you can do what ever you want with HKEY_CURRENT_USER on Vista. If using keyword #RequireAdmin in your script you have ability to do the same thing with HKEY_CLASSES_ROOT or HKEY_CURRENT_CONFIG and not fully everything with HKEY_LOCAL_MACHINE and HKEY_USERS. Yes I know... But if I put that in it, the user who use it, will not know why the scripts doenst work. AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.
trancexx Posted October 1, 2008 Posted October 1, 2008 AlmarM said: Yes I know...But if I put that in it, the user who use it, will not know why the scripts doenst work.AlmarMAnd will not work because... ? ♡♡♡ . eMyvnE
AlmarM Posted October 2, 2008 Author Posted October 2, 2008 trancexx said: And will not work because... ?Because you said: trancexx said: You cannot write to HKLM on Vista unless having full administrator rights.AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.
mscrx Posted October 2, 2008 Posted October 2, 2008 nice tool. one thing from my side. if you don't select anything and click go it will add a blank line. maybe you can build in an error if nothing was selected. otherwise no sense in that. thanks
trancexx Posted October 2, 2008 Posted October 2, 2008 AlmarM said: Because you said:That's why #RequireAdmin is used.Try Vista somewhere, you may even like it ♡♡♡ . eMyvnE
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