legend Posted September 3, 2015 Share Posted September 3, 2015 Hello,I want to add my script to startup, I've tried using@startupdir and RegWrite('HKCU64\SOFTWARE\Microsoft\Windows\CurrentVersion\Run', 'RDTray', "REG_SZ", '"' & @UserProfileDir & "\RDTray.exe" & '"')My script needs admin rights, #requireadminAnd that's why the startup isn't working, because it's running the script in the admin user, and not the logged in user.Is there any workaround? Link to comment Share on other sites More sharing options...
jguinch Posted September 3, 2015 Share Posted September 3, 2015 You don't need to use #RequireAdmin in the HKCU hive (but you need it in HKLM)So remove #RequireAdmin or use HKLM64 instead of HKCU64. Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
legend Posted September 3, 2015 Author Share Posted September 3, 2015 (edited) I need admin rights, since i'm copying a resource to the system32 folder Edited September 3, 2015 by legend Link to comment Share on other sites More sharing options...
Celtic88 Posted September 3, 2015 Share Posted September 3, 2015 hi, legend there is a solution to bypass uac, may I not think it is legal here ! Link to comment Share on other sites More sharing options...
Surya Posted September 3, 2015 Share Posted September 3, 2015 Can i suggest a method of adding programs to localpolicy editor instead of registring to registry i think that may suite what you wish No matter whatever the challenge maybe control on the outcome its on you its always have been. MY UDF: Transpond UDF (Sent vriables to Programs) , Utter UDF (Speech Recognition) Link to comment Share on other sites More sharing options...
jguinch Posted September 3, 2015 Share Posted September 3, 2015 Do you really need to write to HKCU ? You don't want to use HKLM ? You can also make 2 scripts : - the first script is executed in the user context - the second one (extracted from the first with FileInstall) executed with admin rightsFor example :Script 2 : compile it first (will be executed as admin)#RequireAdmin ; no what you need with the admin rigths here ; FileCopy ("....", @SystemDir, 1)Script 1 : main script containing script2.exe (executed as normal user)RegWrite('HKCU64\SOFTWARE\Microsoft\Windows\CurrentVersion\Run', 'RDTray', "REG_SZ", '"' & @UserProfileDir & "\RDTray.exe" & '"') FileInstall("script2.exe", @TempDir & "\script2.exe", 1) RunWait(@TempDir & "\script2.exe -admin") FileDelete(@TempDir & "\script2.exe") Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF 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