Posted on 2006-04-26
Last Modified: 2010-04-11
Please take a look at

even though it says vb , we are actaully trying to figure out command line pgp..
Question by:Sara_j_11

    Author Comment

    basically I am trying to do this:
     pgp –s c:\test.txt –e DOH_PGP_KEY -z "my passphrase sentence" +force
    It still asks me the question that prompts me to enter y/n ( are you sure that u want to use this public key y/n)
    and then I have to answer y and then it produces the encrypted file for me. But I want to automate that script so that I do not have to go to c: everytime I want to encrypt the file. so I want to bypass that question (y/n). How do I do this? I thoughht the +force would solve the problem...


    Expert Comment

    echo y| pgp –s c:\test.txt –e DOH_PGP_KEY -z "my passphrase sentence" +force

    That should do it!  Also, the "y" can be replaced with whatever key you're trying to simulate.

    Good luck,

    Author Comment

    do you mean type the above mentioned:
    echo y| pgp –s c:\test.txt –e DOH_PGP_KEY -z "my passphrase sentence" +force

    in the command prompt.. I tried that , but it does not work... Also what do you mean by : "y" can be replaced with whatever key you're trying to simulate.
    does that mean i have to do:
    echo DOH_PGP_KEY | pgp –s c:\test.txt –e DOH_PGP_KEY -z "my passphrase sentence" +force
    I tried both , but does not work..


    Author Comment

    it still asks me that question:
    WARNING: Because this public key is not certified with a trusted signature , it is not known with high confidence that it actually belongs to DOH_PGP_KEY(email_id)
    Are you sure you want to use this public key(y/N)?
    At that point if I pick y , it creates the file, but how do i make it accept it by default

    Author Comment

    HOW TO MAKE SURE THAT :  the key is signed/certified ?

    Author Comment

    ok I did the following and now it works in command line..
    There are 2 steps that I followed:
    1) You should change trust parametesrparameters for someone's public key (pgp -ke)
    2) Than you should sign this public key with yours (pgp -ks)

    Now if i go to command prompt(C:\Program Files\Network Associates\PGPcmdln) and type
    pgp –s test.txt –e DOH_PGP_KEY -z  "mypassphrase"

    But I dont want to go to the command prompt every time to type this , insteas I want to create a batch file that I can double clcik.
    I opened notepad and typed
    cd C:\Program Files\Network Associates\PGPcmdln
    pgp –s test.txt –e DOH_PGP_KEY -z  "mypassphrase"

    and saved it as batch.bat . But wehn I click on it it does not create the encrypted file , but it works if i do the same thing in the command prompt manually... Can you please help with this?

    Author Comment

    ok I finally got the batch file to work

    Accepted Solution

    PAQed with points refunded (500)

    Community Support Moderator

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
    Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now