Creating .bat file to run a series of specific commands RRS feed

  • Question

  • I need to create a batch file to run a series of simple commands for a specific task.

    I'm going to send someone a certificate encrypted PDF along with the public key (.pfx file) because I only want that party to be able to see the pdf. But that won't stop them from sending both the PDF and the public key to a third party, which will allow them to view it also.

    That's why I want to write a batch file to allow the first party to install the public key, and once that installation is done, I want it to delete the .pfx file as well.

    I have zero knowledge in writing scripts and commands, and all I've been able to do from browsing through forums is to create 2 single line code batch files: one to run the .pfx, and one to delete the file. But that's only if I know the location of the file on the hard drive. So how can I combine these 2 commands into a single batch file, that will allow it to detect where the other party has saved the file, execute it and after installation, delete the file.

    Please, any advice would help me greatly!

    Wednesday, June 10, 2015 3:12 AM


  • Hi,

    How did you send the file and the key to the first party, if you send them, then the file and the key should be stored on the first party computer, then the owner should be able to send them out.

    To create a script, you may also post in the official scripting guys forum:



    Yan Li

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, June 11, 2015 6:26 AM