Jump to content

Recommended Posts

Posted (edited)

I am currently trying to learn to use AutoIt and thought I would try something simple to begin with.

I use a program called DownloadScan that repairs corrupt rar files with par2 sets, my problem is that the commandline usage requires folders with paths in to be enclosed in quotes and this is where I am having problems.

The following code works with folders that have no spaces in the names but I am unable to figure out how to enclose the $CmdLine[2], folder path variable, in quotes so the program runs.

;Set the location of DownloadScan.
$DS = @ProgramFilesDir & "\uA PowerPack\DownloadScan\downloadscan.exe"
;Run DownloadScan with the variables passed to it, $CmdLine[1] = -auto, $CmdLine[2] = Folder path
Run($DS&" "&$CmdLine[1]&" "&$CmdLine[2])

;Wait until the windows is active
WinWaitActive("DownloadScan by OtakuCODE")

;Get the text on the status bar .
$Status = ControlGetText ("DownloadScan by OtakuCODE", "", "WindowsForms10.msctls_statusbar32.app31")

;While the text doesn't equal "Ready.", keep checking the text.
Do
$Status = ControlGetText ("DownloadScan by OtakuCODE", "", "WindowsForms10.msctls_statusbar32.app31")
Until $Status = "Ready."

;Status bar text is "Ready.", assume DownloadScan has completed.
;Delete the redundant .NFO and .Sfv files
FileRecycle($CmdLine[2] & "\*.nfo")
FileRecycle($CmdLine[2] & "\*.sfv")
Exit

I have been searching through the AutoIt forums for an hour but haven't found anything to assist me, back off there now to post the same.

Thanks

Sorted thanks to herewasplato at the AutoIt forums

Edited by benners

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