Jump to content
Sign in to follow this  
zentree

Running a program with command switches

Recommended Posts

#Include <File.au3>


_SearchFileForText( "C:\test.txt", "C:\newfile.txt")
 MsgBox(0,"Phase 1 complete","This is working")





Func _SearchFileForText($pathtoInput, $pathtoOutput)

Dim $array
MsgBox(0,"b4", $lines)
$inputpath = $pathtoInput
$md5result = "test"
$outputpath = $pathtoOutput
$newfilehandle = FileOpen($outputpath)
$oldfilehandle = FileOpen($inputpath)
$lines = _FileCountLines($inputpath)


_FileReadToArray($inputpath,$array) ;writes all lines in the file to an array, each entry in the array is a line
MsgBox(0,"b5", $lines)

For $x = 1 To ($lines )

    $md5result = Run("md5.exe "+ $array([$x]))

    FileWriteLine($md5result) ;writes the found search string into the new file


Next
 MsgBox(0,"Done","This is working")
FileClose($newfilehandle)
FileClose($oldfilehandle)


EndFunc

Hopefully it's a quick question:

I want to basically run through an loop where each time:

It reads a line from a text file, the line has a file path in it.

Then want to run a program called md5.exe with the parameter of the file name just read from file.

This program outputs a string with the md5 of the file in question, which I then want to write to the second file.

The loop and array should work fine since I've ripped them from a parser I wrote. It's the syntax of how to do the "md5.exe filenamehere" That I don't know.

Thanks for your time.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...