Garrett19212 Posted March 20, 2005 Share Posted March 20, 2005 How can i make the script move itself to the startup folder so it will run everytime you start ur comp. I mean like wats the code to make it move itself to that folder. Link to comment Share on other sites More sharing options...
buzz44 Posted March 20, 2005 Share Posted March 20, 2005 u dont put it in a folder to run on startup... u need to put it in the registry i forget the key name sry qq Link to comment Share on other sites More sharing options...
Rex Posted March 20, 2005 Share Posted March 20, 2005 Ther are a few places in the registry u can put a ref. If it's only once the script should run then. 1. the script only runs under current user 2. is global or for all users [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Runonce] "NAME"="PATH TO FILE" ; Eg. "C:\\MY file.exe" rember to use \\ and not \ in paths or [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce] "NAME"="PATH TO FILE" ; Eg. "C:\\MY file.exe" rember to use \\ and not \ in paths If you want it to run every time the ps starts, then you have 2 choices. 1. the script only runs under current user 2. is global or for all users [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run] "NAME"="PATH TO FILE" ; Eg. "C:\\MY file.exe" rember to use \\ and not \ in paths or [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run] "NAME"="PATH TO FILE" ; Eg. "C:\\MY file.exe" rember to use \\ and not \ in paths Link to comment Share on other sites More sharing options...
MHz Posted March 20, 2005 Share Posted March 20, 2005 rember to use \\ and not \ in pathsOnly *.reg files use \\ for registry entries. Not Autoit or Reg.exe. Link to comment Share on other sites More sharing options...
Rex Posted March 20, 2005 Share Posted March 20, 2005 @MHz U'r right. I should have mentionet it in my post. Im still new to AutoIt, and still have hangovers form dos programming where i call *.reg files. :-) Link to comment Share on other sites More sharing options...
Garrett19212 Posted March 21, 2005 Author Share Posted March 21, 2005 So wat would the code be for it to copy its self to the registry to it starts up every time Link to comment Share on other sites More sharing options...
steveR Posted March 21, 2005 Share Posted March 21, 2005 $regPath = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" $progName = "Notepad" $filePath = "C:\Windows\notepad.exe" regWrite($regpath, $progName, "REG_SZ", $filePath) AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass. Link to comment Share on other sites More sharing options...
Garrett19212 Posted March 21, 2005 Author Share Posted March 21, 2005 $regPath = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" $progName = "Notepad" $filePath = "C:\Windows\notepad.exe" regWrite($regpath, $progName, "REG_SZ", $filePath)<{POST_SNAPBACK}>Wat would it be for my program? Say the name of it is test.exeWould it be$regPath = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" $progName = "test" $filePath = "C:\Windows\test.exe" regWrite($regpath, $progName, "REG_SZ", $filePath)<{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
steveR Posted March 22, 2005 Share Posted March 22, 2005 Yes, only if test.exe is in C:\Windows\ AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass. Link to comment Share on other sites More sharing options...
MHz Posted March 22, 2005 Share Posted March 22, 2005 This might be easier ? $regPath = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" $progName = StringTrimRight(@ScriptName, 4) $filePath = FileGetShortName(@ScriptFullPath) regWrite($regpath, $progName, "REG_SZ", $filePath) Link to comment Share on other sites More sharing options...
Garrett19212 Posted March 24, 2005 Author Share Posted March 24, 2005 How would i do an If Than Else for it? Like If it already exsists in the registry for startup than end if Else create it in the registry for start up End If Link to comment Share on other sites More sharing options...
Rex Posted March 24, 2005 Share Posted March 24, 2005 How would i do anIf Than Elsefor it?LikeIf it already exsists in the registry for startup than end ifElse create it in the registry for start upEnd If<{POST_SNAPBACK}>You need to create a $var = regread(String)$var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "String") if Not $var = "prog.exe" then MsgBox(0, "Prog","Dont exist") Else MsgBox(0, "Prog", "Eksist") EndIf 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