Venom4444 Posted September 10, 2010 Share Posted September 10, 2010 Hi to all there. Can i convert the Bat command to autoit.? copy *.ocx %windir%\system32 /y for /f %%s in ('dir /b *.dll') do regsvr32 /s %s for /f %%s in ('dir /b *.ocx') do regsvr32 /s %s regedit /s NetTools5.0.reg Please assist me.? HOW Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 10, 2010 Share Posted September 10, 2010 Start with the help file. Try out the basic tutorials there. You might also be interested in the AutoIt 1-2-3 full tutorial linked below in my sig. Get familiar with FileCopy(), RunWait(), FileFindFirstFile() and FileFindNextFile(). By the time you do that, this will be a very easy script for you. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Varian Posted September 10, 2010 Share Posted September 10, 2010 Either pure AutoIT#Include <File.au3> Local $Destination = @WindowsDir & '\System32' $OCXes = _FileListToArray(@ScriptDir, '*.ocx', 1) $DLLs = _FileListToArray(@ScriptDir, '*.dll', 1) If IsArray($OCXes) Then For $i = 1 to $OCXes[0] FileCopy(@ScriptDir & '\' & $OCXes[$i], $Destination & '\', 1) RunWait('regsvr32 /s "' & $Destination & '\' & $OCXes[$i] & '"') Next EndIf If IsArray($DLLs) Then For $i = 1 to $DLLs[0] FileCopy(@ScriptDir & '\' & $DLLs[$i], $Destination & '\', 1) RunWait('regsvr32 /s "' & $Destination & '\' & $DLLs[$i] & '"') Next EndIf RunWait('regedit /s NetTools5.0.reg')or run the commands within AutoITOpt('ExpandEnvStrings', 1) RunWait(@ComSpec & ' /c copy *.ocx %windir%\system32 /y', @ScriptDir) RunWait(@ComSpec & " /c for /F %s in ('dir /b *.*') do regsvr32 /s %s") RunWait(@ComSpec & " /c for /f %s in ('dir /b *.ocx') do regsvr32 /s %s") RunWait('regedit /s NetTools5.0.reg')but the latter way registers the DLLs and OCXes from the current directory, not from the %WINDIR%\System32 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