Venom4444 0 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 Share this post Link to post Share on other sites
PsaltyDS 39 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 Share this post Link to post Share on other sites
Varian 8 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 Share this post Link to post Share on other sites