Sign in to follow this  
Followers 0
Venom4444

For %11 Comand

3 posts in this topic

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



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

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 AutoIT
Opt('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

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0