SuperNatural Posted April 4, 2015 Share Posted April 4, 2015 Hello, I'm trying to run a .Reg file Silently, using Run. I succeed by this method: Run("REGEDIT /S Test.reg") But, I was trying to run a .Reg file from another folder silently, and nothing happend. I was trying to do it this way: Run("REGEDIT /S", @ProgramFilesDir & "Test.reg") And no success :/ Why's that? I'll be glad to get help ! Thank you. Link to comment Share on other sites More sharing options...
Kyan Posted April 4, 2015 Share Posted April 4, 2015 Are you trying to write to HKLM? if so, you need admin rights, that's maybe your issue SuperNatural 1 Heroes, there is no such thing One day I'll discover what IE.au3 has of special for so many users using it.C'mon there's InetRead and WinHTTP, way better Link to comment Share on other sites More sharing options...
SuperNatural Posted April 4, 2015 Author Share Posted April 4, 2015 Are you trying to write to HKLM? if so, you need admin rights, that's maybe your issue You are right, thank you. Well, any way to bypass that thing or something? Because in my computer, I have admin rights, and it doesn't work :/ Link to comment Share on other sites More sharing options...
JohnOne Posted April 4, 2015 Share Posted April 4, 2015 Add #RequireAdmin to code. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
l3ill Posted April 4, 2015 Share Posted April 4, 2015 When doing stuff like this I always run a sanity check to make sure my path is correct $test = (@ProgramFilesDir & "\test.reg") ConsoleWrite("test = " & $test) My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
jguinch Posted April 4, 2015 Share Posted April 4, 2015 @SuperNatural : you code cannot work because of the wrong syntax you use. Replace Run() by ShellExecute, or change your code like this : Run('REGEDIT /s "' & @ProgramFilesDir & '\Test.reg"') Also #RequireAdmin is needed if the UAC is enabled Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
SuperNatural Posted April 4, 2015 Author Share Posted April 4, 2015 Add #RequireAdmin to code. When doing stuff like this I always run a sanity check to make sure my path is correct $test = (@ProgramFilesDir & "\test.reg") ConsoleWrite("test = " & $test) @SuperNatural : you code cannot work because of the wrong syntax you use. Replace Run() by ShellExecute, or change your code like this : Run('REGEDIT /s "' & @ProgramFilesDir & '\Test.reg"') Also #RequireAdmin is needed if the UAC is enabled First, thank you all. jguinch - the code you changed for me works pretty well. I may run the .Reg file from a different folder, but still, can't change the HKLM (only CURRENT_USER). That's weird, because my UAC is disabled. Also, I tried to add #RequireAdmin, but it seems nothing happend :/ Link to comment Share on other sites More sharing options...
Kyan Posted April 4, 2015 Share Posted April 4, 2015 It needs to be added at the top of your script. You can use RegWrite with autoit if it isn't a big reg file Heroes, there is no such thing One day I'll discover what IE.au3 has of special for so many users using it.C'mon there's InetRead and WinHTTP, way better 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