xcaliber13 Posted October 6, 2016 Share Posted October 6, 2016 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 Link to comment Share on other sites More sharing options...
Anoop Posted October 6, 2016 Share Posted October 6, 2016 (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 October 6, 2016 by Anoop Link to comment Share on other sites More sharing options...
AutoBert Posted October 6, 2016 Share Posted October 6, 2016 (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 October 6, 2016 by AutoBert Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now