|I'm trying to push out an .ini file to each remote user profile via a batch script. The .ini file sits on the server and needs to go into the \Application Data folder (for Win XP) for each profile that logs in (\AppData\Roaming folder for Win7). That way the software installed on their laptop runs for our config. Here's what I initially tried:|
IF "%allusersprofile%"=="C:\ProgramData" GOTO WIN7
XCOPY "\\ServerName\C:\File\file.ini" "%UserProfile%\Application Data\" /C /S /D /Y /I /V
XCOPY "\\ServerName\C:\File\file.ini" "%UserProfile%\AppData\Roaming\" /C /S /D /Y /I /V
This didn't work. At first we were thinking it's because the Application Data/AppData folders are "Read Only". But then I tried this as a test which worked - same location, just spelling out the path to the remote PC:
XCOPY "\\ServerName\C:\File\file.ini" "\\PC\c$\USERS\metheuser\appdata\roaming\" /C /S /D /Y /I /V
When I check the SET in CMD, the path for %UserProfile% comes up with the C drive as "C:" - not "C$". So now I'm thinking it may be a security/authentication issue. Without placing the local admin name and PW in the BAT file, is there any other workaround or other suggestions?