Jump to content

run a .reg file in autoit


Recommended Posts

i know how to add reg keys in auto it but what about a .reg file? i exported some things from the registry to a .reg file and it is way too much for me to put it into an autoit file, so i was wondering if there was some way that i could do like Run("reg.reg") but that deosnt work.

Link to comment
Share on other sites


What if I want to run the .reg file from another path and want to use a directory macro.

For exemple, I want to run reg.reg that is in the system drive, under \install.

What do I put?

Run("REGEDIT /S @homedrive & \install\Reg.reg")

- this does not work

Can someone help this Autoit newbie?

Thanks.

Link to comment
Share on other sites

  • 2 months later...

blinkdt -

Thanks for the FYI :)

MCT -

Well you don't get that little flicker from the command window. Hehe one of the few times autoit makes installs just a little cleaner. ;)

Well really MHz added in some code to his CMENU context menu utility that will actually convert most reg files to pure autoit scripts...which then you could convert into exe's so that you have a tad more security hidding important info contained in your reg files.

Really at this point in the game I see no real reason to use cmd files at all and soon there won't be any need for vbs ether.

There is so much more to autoit than silly install scripts like I have displayed in the autoit thread.

Any thing you can currently do in a cmd file you can do in autoit...and autoit is far more flexable.

Go to AutoIts actual forum and see some of the samples they have to show...it'll blow your mind. :)

Link to comment
Share on other sites

I just use

Example importing file.reg

#include <Process.au3>
_RunDos("reg import file.reg")

for removing the keys use the long way it works perfect

Example removing autostart of MSN

RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "MsnMsgr")

The 1. method for removing .reg contains:
Windows Registry Editor Version 5.00

;Disable MSN
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
"MsnMsgr"=-
dosent work durring install of windows

Link to comment
Share on other sites

  • 5 years later...

how would a folder with more then one reg file be applied useing autoit

Copy au3 file or compiled in the folder where reg files are located

#Include <File.au3>
#Include <Array.au3>

$RegList = _FileListToArray(@ScriptDir, "*.reg", 1)
If IsArray($RegList) Then
For $i = 1 to $RegList[0]
RunWait('regedit.exe' & ' /s' & ' "' & $RegList[$i] & '"')
Next
EndIf

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...