Help - Search - Members - Calendar
Full Version: run a .reg file in autoit
MSFN Forums > Unattended Windows Discussion & Support > Application Installs

   


Google Internet Forums Unattended CD/DVD Guide
ripken204
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.
Mekrel
Your going to need:

Run("REGEDIT /S Reg.reg")
ripken204
that simple, thx
JohnS
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?
CODE
Run("REGEDIT /S @homedrive & \install\Reg.reg")
- this does not work
Can someone help this Autoit newbie?
Thanks.
ripken204
you could try

Run("REGEDIT /S @homedrive & '\install\Reg.reg'")
Nologic
hmm close...more like:

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

How ever may need 8.3 file names???

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

but thats just taking a guess.
JohnS
Thank you, you guys are great!
blinkdt
I second that! This one has bugged me for ages. Special thanks to Nologic for bringin' it home!
Nologic
Your welcome.

Question...was 8.3 file names needed? I never did find out. smile.gif
blinkdt
Nope, FileGetShortName was not needed. I'm converting many of my scripts based on your find and everything is running smoothly, like so:

Run("REGEDIT /S " & @ScriptDir & "\prefs.reg")
MCT
do u find any (if any) advantages on using autoit vs cmd ?
Nologic
blinkdt -

Thanks for the FYI smile.gif

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. newwink.gif

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. smile.gif
--=ddSHADOW=--
I just use
CODE
Example importing file.reg

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


for removing the keys use the long way it works perfect
CODE
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




Google Internet Forums Unattended CD/DVD Guide

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.