XCOPY batch file does not run for non-admins
Trying to use XCOPY in a batch file to copy a directory and a file into %APPDATA% for each user that signs into a machine. Using SCCM 2012 SP1 R1 to deploy. Built as a package/program and runs with users rights, install runs once per user logon on the machine. The deployment is set to install from the DP. I think my issue is that non-admin users don't have rights to copy files from the DP to the Roaming folder in %APPDATA%. The same case is likely if I were to set the deployment to download and install locally, I think I would still hit the same issue not having rights to copy files from the ccmcache folder to %APPDATA%.
I am trying to sort out what I need to modify in either the script that runs or the deployment in SCCM.
Here is the script that runs in the batch file...
@echo off
XCOPY "source_filepath" "%APPDATA%\SketchUp\SketchUp 2014\SketchUp\Plugins" /Q /R /Y /S /I
EXIT
I am open to any suggestions on how I can make this work.
-Adam
Answers (3)
Took a bit of a break on this as we've been deploying Office 2013 company wide. I think I've got it working.
It's still a batch file called from a Package/Program in SCCM.
.BAT file runs the following script..
if not exist "%APPDATA%\SketchUp\SketchUp 2014\SketchUp\Plugins" md "%APPDATA%\SketchUp\SketchUp 2014\SketchUp\Plugins"
XCOPY /y /e "%~dp0SNPFiles\*.*" "%APPDATA%\SketchUp\SketchUp 2014\SketchUp\Plugins"
I used the basic script structure from one I found here (http://blog.configmgrftw.com/copying-files-to-clients-using-configmgr/). Then modified the directoies to fit my needs. the %~dp0 keeps me from having to hard code the source file location in the script.
Program config in SCCM is as follows..
Runs Hidden, only when a user is logged in, with user's rights, UNC name, runs once for every user who logs in. Does the trick through Software Center for both Admin and Non-Admin accounts.
Thanks again for the help guys. If I didn't take your advice directly it still helped steer me in a direction that works for me.
Comments:
-
I have done that from time to time, but in general that is something I try to avoid since we don't make a habit of storing all of our software install files in user facing directories. If I exhaust all other possibilities then I don't have a huge issue with resorting to that. Thanks for the comment. - quattro004 10 years ago
-
you can create a read only user to the area you want and use a "net use" command to map a drive to the server via that user in your batch file then xcopy from that drive source
@echo off
start /wait net use x: \\sccmserver\ccmcache /user:domain\installer password
start /wait XCOPY "x:\source_filepath" "%APPDATA%\SketchUp\SketchUp 2014\SketchUp\Plugins" /Q /R /Y /S /I
start /wait net use x: /delete
EXIT - SMal.tmcc 10 years ago
Comments:
-
I have used this method successfully on several occasions and currently using it for Java 7.0.67. So quattro004, you should consider what EdT has suggested. - 786_ak 10 years ago