how to replace text in files located on remote servers ?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
jmclej
Posts: 1
Joined: 02 Apr 2021 07:00

how to replace text in files located on remote servers ?

#1 Post by jmclej » 02 Apr 2021 07:06

Hello,
I need to replace all the occurrences of the text "http:\\toto.com\" to "http:\\toto-preprod.com\" in a list of files that I know but that are located on different remote servers.

server1 : C:\arbo1\...\file.config
server1 : C:\arbo2\...\file.config
server1 : C:\arbo3\...\file.config
server2 : C:\arbo4\...\file.config
server2 : C:\arbo1\...\file.config

I guess finding a replace function is easy but I have no idea how to connect to remote servers via a script (dos or powershell). For each server, the scriptg needs to ask for the credentials.
If it is not possible in a batch, I am OK for a C# solution.
Thanks

Post Reply