How can I encrypt password in a batch file?

18,734

Not exact answer to the question, but, as per the comments discussion and your acceptance to the alternate approach, the below might help you to inline encode the password and pass as a parameter to WMIC:

Base64 Encode "string" - command-line Windows?

Share:
18,734
biswajit
Author by

biswajit

Hello, there!

Updated on June 04, 2022

Comments

  • biswajit
    biswajit almost 2 years

    I have a batch file which is used to connect to a remote server.

    Tha batch file contains:

    WMIC /NODE:"ip_address" /user: user_name /password: pass_word process call create "path\abc.bat"

    I want to encrypt pass_word.

  • Awan Biru
    Awan Biru almost 4 years
    Base64 just encode the password to base64 literals. It is not an encryption scheme as asked by @Biswajit Paul above
  • vijayinani
    vijayinani almost 4 years
    @Awan Biru ... Did you go thru the comments in the question? He is fine with simple encoding decoding too. So this answer. Have some time to go thru comments before deciding.
  • Awan Biru
    Awan Biru almost 4 years
    Since, original question did not changed, aren't your answer more suitable as comment instead? Your answer could misleads other readers, since encoding is not encrypting.
  • vijayinani
    vijayinani almost 4 years
    Have altered my answer. And moreover this is not heavily voted question to rely upon. The question is very raw to refer. You will find many such threads on sof.