Jump to content

using the dos FOR command insite a script

Recommended Posts

I'm hoping someone can assist me on this one... I'm in the process of replacing a batch file with an autoit .exe file. This line in question is below.

for /f %%s in ('dir /b *.dll') do regsvr32 /s %%s

basically its supposed to scan a folder for all the .dll files, and then use the regsvr32 command to reregister them all.

any suggestions?

note: until today, i had no idea that the "for" command even existed as a dos command.

Thank You


Link to post
Share on other sites

Dim $Filename

$Folder = @SystemDir & "\YourDLLFolder"
$search = FileFindFirstFile($Folder & '\*.dll')

If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")

While 1
    $filename = FileFindNextFile($search)
    If @error Then ExitLoop
    $Filename = $Folder & '\' & $filename
    If StringRight($Filename, 3) = "dll" Then RunWait('regsvr32 /s "' & $Filename & '"', @SystemDir)

Edited by SlimShady
Link to post
Share on other sites

wow slim... THANK YOU...

i really appreciate the quick response... can i send you a tip or something?



:idiot: If I would get 10 bucks for every time I helped someone, I would be a rich man. :D

You don't have to give me anything, I like helping people.

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...