Jump to content

Silent Pasword


Recommended Posts

I know all here sure can solve this.

I have a pdf file which have a password.

Now i want anybody open that file using my GUI program develepod using autoit without they need to enter password and user did not know the password.

It's mean autoit enter password in silent way. User will not see the password has entered by autoit. ( i mean all the way at the back)

But if user open pdf file directly without using my GUI, they fail open the pdf file because it have a password.

I try use

$PDF_loc = FileGetShortName($filepdf); your file name/location

Run(@ComSpec & " /c Start " & $PDF_loc, "", @SW_HIDE)

But the problem is, my start menu stay appear then the PDF program has not activate.

It's important to me to protect my file from duplicated by user.

My GUI use hard disk serial number so that only certain PC can open that file.

Hopefully all briliant people here can help me.

Sorry i disturbing your time. Tq very2 much.

Edited by manmoncang
Link to comment
Share on other sites

You should figure out if your pdf reader has a commandline option for passing in the password. Or, if your pdf reader can be automated through COM or dllcall.

EX: in a cmd (command) box cd to the folder where you have acroread and type acroread /?

I did this with foxitreader but no option for a password

Obviously you could use send("keys to enter pwd") but it would be to easy for others to figure out you pwd. Passing it as a comandline is not wery secure either!

Link to comment
Share on other sites

$winTitle and $winText whould work with English version of Adobe Reader 7 but might need changed for other versions.

Opt("WinWaitDelay", 10)

$filepdf = "C:\exampleProtectedFile.pdf"
Run(@ComSpec & " /c Start " & FileGetShortName($filepdf), "", @SW_HIDE)

;Look for the password popup window
$winTitle = "Password"
$winText = "Please enter a Document Open Password."

WinWait($winTitle, $winText, 5);five second timeout so that script doesn't hang....
If @error Then Exit
    
ControlSetText($winTitle,"","Edit1","password")
ControlClick($winTitle, $winText,"OK")
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

$winTitle and $winText whould work with English version of Adobe Reader 7 but might need changed for other versions.

Opt("WinWaitDelay", 10)

$filepdf = "C:\exampleProtectedFile.pdf"
Run(@ComSpec & " /c Start " & FileGetShortName($filepdf), "", @SW_HIDE)

;Look for the password popup window
$winTitle = "Password"
$winText = "Please enter a Document Open Password."

WinWait($winTitle, $winText, 5);five second timeout so that script doesn't hang....
If @error Then Exit
    
ControlSetText($winTitle,"","Edit1","password")
ControlClick($winTitle, $winText,"OK")

Tq CyberSlug

It's awesome. You are so briliant

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...