I need help to create a bat to send SAPLOGON.ini file [closed]

-2

I need help to create a bat to send SAPLOGON.ini file for all users, with profile created on the computer.

This is my bat code, I need to help, I want to send all users one at a time.

See below:

@ECHO Copia Config SAP LOGON Padrão.


xcopy "\meuservidor\SAP\SAPLOGON.INI" C:\Users\%USERNAME%\AppData\Roaming\SAP\Common /Y

It only works for the user who is logged in, since another user with profile created does not work, I need help, for this bat to work and send it to all profile users on the computer.

    
asked by anonymous 15.07.2017 / 20:07

1 answer

0

If you use the command for Windows 7 or higher :

cd C:\Users

dir /b > Users.txt

for /F "tokens=*" %%A in (Users.txt) do (
    if exist "C:\Users\%%A\AppData\Roaming\SAP\Common" (
        xcopy "\meuservidor\SAP\SAPLOGON.INI" "C:\Users\%%A\AppData\Roaming\SAP\Common" /Y
    )
    else (
        echo Pasta "C:\Users\%%A\AppData\Roaming\SAP\Common" nao existe!
    )
)

pause

If it is Windows XP replace C:\Users with C:\Documents and Settings

  

You'll probably have to run as an Administrator.

    
17.07.2017 / 00:54