I need help creating a bat to send SAPLOGON.ini file

Asked

Viewed 750 times

-2

I need help creating 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 to all users, at once.

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, for another user with created profile does not work, I need help, for this bat work and send to all users with profile on the computer.

1 answer

0


If using the command to 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 for C:\Documents and Settings

You will probably have to run as Administrator.

  • 1

    Perfect, Voce saved my life...lol...

  • Evaluate the answer then, little arrow up!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.