How to write the code into the Bat file?

i want to create the SAMBA link by the bat file,but how can i write the code into the bat file?


Write code into notepad file and save it as .bat instead of .txt.

but i only want 1 file.


Yes it will be one file only.

I already have a .bat file.I want to change the code on it


Open the .bat file with Notepad and you can edit it.

I want to change it when my UIPath progam is running

Hey @zzzcoin

You can use the following code in Invoke Code activity to write your text:

string path = @"C:\Users\Parth\Documents\UiPath\Forum_Solutions\TestBATFile.bat";//file path
using(StreamWriter sw = File.AppendText(path))//if you want to append

Check if this helps!

hi,is this code written by c#?

yes @zzzcoin and you can use it in Invoke Code Activity in UiPath

Like this:

uh,but my project uses vb

It is fine. In invoke code you can still use it.

I will attach workflow file. (16.7 KB)

In this check the Update BAT File Workflow.

thanks a lot ,my friend!

No problem, let me know if you face any issues @zzzcoin

And, if you find the workflow file please mark it as solution so it can help others.


Could you tell me how to mark it as solution

@zzzcoin below my reply you will see something like this so you can click on that


Just click on that

got it!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.