Insert user and password into bat file

0

I have a .bat file that automatically copies files from one server to another. We are updating the environment and this server will be modified and when testing .bat I received the following error:

Falha de logon: nome de usuário desconhecido ou senha incorreta.

Is there a way to pass user and password on a command like below?

@echo INICIO VENDAS
@echo.

copy \192.168.203.130\ebsout\*.txt c:\wamp\www\SIG\ /y
    
asked by anonymous 10.06.2016 / 13:31

1 answer

0

I believe you have to save the password on windows in a previous run, then be used by bat in future executions automatically by using credentials:

runas.exe /env /noprofile /savecred /user:<IP do Servidor> senha /USER:usuário

This command at first run will ask you the password and save the user credential for future executions.

To edit in graph mode or here ( quote command too )

    
03.12.2018 / 03:57