Sign in to follow this  
Followers 0
keilamym

using the dos FOR command insite a script

5 posts in this topic

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

Keilamym

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Dim $Filename

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

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

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

Edited by SlimShady

Share this post


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?

Keilamym

Share this post


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?

Keilamym

<{POST_SNAPBACK}>

: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.

Share this post


Link to post
Share on other sites

: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.

<{POST_SNAPBACK}>

well thanks again...

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