Nuffilein805 Posted October 19, 2005 Share Posted October 19, 2005 made a little prog, cause i want most of my progs to start if the computer starts, but i didn't want to use the autostart-thing, cause some people at my work check this quite often and remove progs they don't know or recognize, so i decided to write a value to the registry to automate the start the prog uses the original windows folder and by now works as it should (haven't discovered any bug yet, but that doesn't mean there ain't any) here's the code expandcollapse popup;this programm uses the registry as autostart_option ;only works as admin ;made by Marten Zimmermann #include <guiconstants.au3> GUICreate ("Main", 600, 100, -1, -1, -1, $WS_EX_ACCEPTFILES) ;the regvalue GUICtrlCreateLabel ("Registryvalue", 10, 10, 100) $regval = GUICtrlCreateEdit ("", 120, 10, 170) ;the programm guictrlcreatelabel ("Programm", 10, 40, 100) $prog = GUICtrlCreateEdit ("", 120, 40, 420, -1, $ES_READONLY, $WS_EX_STATICEDGE + $WS_EX_ACCEPTFILES) $progbut = GUICtrlCreateButton ("...", 550, 40, 40) ;do as you wish button $write = GUICtrlCreateButton ("AutoStartIt", 10, 70, 280) ;set the focus on first control GUICtrlSetState ($regval, $GUI_FOCUS) GUISetState() while 1 $msg = GUIGetMsg() Select ;exit on X case $msg = $GUI_EVENT_CLOSE Exit ;what happens at "..." case $msg = $progbut ;open a filedialog to input the file $file = FileOpenDialog("Choose file...",@WorkingDir,"Exe (*.exe)", 1) ;if there is a file selected update the edit_control if @error <> 1 Then GUICtrlSetData ($prog, $file) EndIf ;what happens at "AutoStartIt" case $msg = $write ;call this function writeit() EndSelect WEnd func writeit() ;check if there is a programm chosen if guictrlread ($prog) <> "" Then ;check if registry-value already exists $a = RegRead ("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", guictrlread($regval)) ;if it doesn't write it if @error = -1 Then $regvalue = StringReplace(guictrlread($regval), " ", "_") $b = RegWrite ("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $regvalue, "REG_SZ", guictrlread ($prog)) ;check if writing was successful if $b = 1 Then msgbox (0, "Success", "Programm automated successfully", 2) Else msgbox (0, "Error", "An Error occured while writing", 2) EndIf Else msgbox (0, "Error", "Key already exists", 5) EndIf Else msgbox (0, "Error", "No programm", 5) EndIf EndFunc hope this is something useful for you as well any suggestions? trying to include admin-mode (changing rights to admin) soon maybe even multiple files at 1 valueregautostart.au3 my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
Nuffilein805 Posted October 19, 2005 Author Share Posted October 19, 2005 just have discovered a little prob with win2k made some minor changes hope it works there now properly this 1 is for win2k-users who discover a little problem with the input- (/edit-) controlsregautostart.au3 my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
peethebee Posted October 19, 2005 Share Posted October 19, 2005 Hi! But why should the admins not control the registry autoruns aswell? Most program's autoruns are located there... and by the way most viruses & co. do so too. But the idea itself is good, I did something similar myself too. peethebee vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Link to comment Share on other sites More sharing options...
Nuffilein805 Posted October 19, 2005 Author Share Posted October 19, 2005 it's just for you as admin to make your progs maybe at your work start with (windows)autorun not the usual start-programs-autorun most of the 'dumb' users won't recognize and even if they do they can't do anything about it my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
peethebee Posted October 19, 2005 Share Posted October 19, 2005 Hi! You are right. peethebee vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Link to comment Share on other sites More sharing options...
mikidutza Posted November 9, 2007 Share Posted November 9, 2007 if you wanted to act like a virus first when you activate the program you delet the registry key, and you se onautoitexit function to write the key again, this way it want by descovered (it just came to me) Link to comment Share on other sites More sharing options...
Virgilio Posted November 17, 2007 Share Posted November 17, 2007 Exelente trabajo, me ha servido para ocultar del inicio mis aplicaciones , gracias Virgilio Link to comment Share on other sites More sharing options...
CoDEmanX Posted December 8, 2007 Share Posted December 8, 2007 how to do something similar under windows vista? manually a program can be added to task scheduler (planner?), everytime when a user logs on with admin rights. but automatic? 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