Jump to content

Recommended Posts

Posted

Hello Everyone,

                I have a command line program that remove password on pdf files.    If I run this command from Autoit it works just fine.

Run('C:\qpdf.exe --password=password --decrypt C:\Temp\Test_Attachment.pdf C:\Temp\Test_Attachment_nopass.pdf')

Now I have several pdf files in the folder that need to have the password removed  So I am trying to run like this

$selectedfolder = "C:\Temp"
$aFileList = _FileListToArray($selectedfolder, "*.pdf", $FLTA_FILES, True)

For $i = 1 To $aFileList[0]
Run("C:\Temp\qpdf.exe --password=password --decrypt "($aFileList[$i])" "($aFileList[$i])"& nopass")
Next

But I keep getting a syntax error. I have tried a few different ways but still getting a syntax error.    Can anyone show me the correct syntax?

Thank  you

Posted (edited)

 

Run("C:\Temp\qpdf.exe --password=password --decrypt " & $aFileList[$i] & " " & $aFileList[$i] & "_nopass")

Try this. If you want to append "_nopass" to end of file name, you will have to extract and manipulate file extension part.

Edited by Anoop
Posted (edited)
53 minutes ago, xcaliber13 said:

But I keep getting a syntax error.

Then you write something which against synta of AutoIt. So read carefully the error message (telling line and what's wrong) and correct it, maybe you have to look in helfile for correfcft syntax.

Please post next time (i hope here is no need) output of the scite console.

Edited by AutoBert

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