run a .reg file in autoit
#1
Posted 29 August 2005 - 02:09 PM
#4
Posted 01 September 2005 - 05:46 PM
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 workCan someone help this Autoit newbie?
Thanks.
#5
Posted 01 September 2005 - 06:50 PM
Run("REGEDIT /S @homedrive & '\install\Reg.reg'")
#6
Posted 01 September 2005 - 07:44 PM
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.
#8
Posted 13 November 2005 - 01:34 PM
#9
Posted 13 November 2005 - 07:54 PM
Question...was 8.3 file names needed? I never did find out.
#10
Posted 13 November 2005 - 09:23 PM
Run("REGEDIT /S " & @ScriptDir & "\prefs.reg")
#11
Posted 13 November 2005 - 09:41 PM
#12
Posted 13 November 2005 - 10:49 PM
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.
#13
Posted 16 November 2005 - 04:17 AM
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
#14
Posted 04 May 2011 - 07:08 PM
#15
Posted 05 May 2011 - 11:20 AM
m00nw0lf, on 04 May 2011 - 07:09 PM, said:
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
#16
Posted 12 May 2011 - 10:14 AM
You are better of to use FileChangDir()
#Include <File.au3>
#Include <Array.au3>
$sPath = "c:\somepath\containing\regfiles"
FileChangeDir($sPath)
$RegList = _FileListToArray($sPath, "*.reg", 1)
If IsArray($RegList) Then
For $i = 1 to $RegList[0]
RunWait('regedit.exe' & ' /s' & ' "' & $RegList[$i] & '"')
Next
EndIf
Also I can't remember if it's okay to put the "/s" switch after the file name or not (for RegEdit) but if it is then instead of RunWait() use ShellExecuteWait()
ShellExecuteWait($RegList[$i], "/s")
#17
Posted 14 May 2011 - 03:44 AM
geosoft, on 12 May 2011 - 10:14 AM, said:
You are better of to use FileChangDir()
#Include <File.au3>
#Include <Array.au3>
$sPath = "c:\somepath\containing\regfiles"
FileChangeDir($sPath)
$RegList = _FileListToArray($sPath, "*.reg", 1)
If IsArray($RegList) Then
For $i = 1 to $RegList[0]
RunWait('regedit.exe' & ' /s' & ' "' & $RegList[$i] & '"')
Next
EndIf
Also I can't remember if it's okay to put the "/s" switch after the file name or not (for RegEdit) but if it is then instead of RunWait() use ShellExecuteWait()
ShellExecuteWait($RegList[$i], "/s")
I've thought about using the script during windows installation (in this case another instance will run the compiled file and it's easy to copy and run from the reg files folder).
Regarding the switch: it's tested and working.
This post has been edited by radix: 14 May 2011 - 03:45 AM
- ← Batch file to find directories
- Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
- Need This Script →



Help

Back to top









