How to replace some text inside a batch file like password?

Hi All

I have a bat file which opens an application and logs in by providing a password. So currently the password is hard coded inside the bat file.

How can we parameterize the password and run the bat file ?

Hey @kkpatel

You can store the credentials in the Windows credential manager vault and retrieve it in the code.

Hope that helps.


my question is how can i pass that to the text written inside the bat file ?

1 Like

Hey @kkpatel

Of course, the same mentioned above.

Once you store the credentials in the windows credentials, you can use Get credential method to retrieve the same.

Hope that helps


Hello @kkpatel ;

Please refer to the below post. It will help to solve your doubt.

Thanks @Rahul_Unnikrishnan .I have seen this post but still m not getting how to pass the parameter.

Can you please give me an example ? I need a hand holding in this, its still unclear to me.

I can run the bat file by using Start Process but how can i change some text inside the bat file ?

@Palaniyappan @supermanPunch @lakshman

Hello @kkpatel ,

You can do as below.

Here text.bat is my batch file which is accepting an argument and I’m passign “6” as the value to the batch script.

Getting the output as below:

Like this way you can pass the credential to your batch script. But you need to modify the batch to accept the parameters.