Jump to content

Syntax error Help

Recommended Posts


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")

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

Share this post

Link to post
Share on other sites


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

Share this post

Link to post
Share on other sites
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

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


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.