geosoft Posted May 12, 2011 Share Posted May 12, 2011 Instead of moving the script or the reg files around to get everything in @ScriptDirYou 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 EndIfAlso 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") Link to comment Share on other sites More sharing options...
radix Posted May 14, 2011 Share Posted May 14, 2011 (edited) Instead of moving the script or the reg files around to get everything in @ScriptDirYou 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 EndIfAlso 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. Edited May 14, 2011 by radix 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