SCCM 2012 - .Bat file not running CMD as administrator
Hello -
I'm trying to run a bat file package that copies a file to a folder in Program Files x86. The bat file needs to run command prompt as admin. When I push the file out it does not run as admin and fails. I have the package set to run as admin
but that doesn't work. Is there a way to make command prompt elevate or is there a different way to get this file copied? It's a dependency of a package to copy a license file.
Thanks
Chris
August 25th, 2015 9:46am
What exactly does you batch file look like? Are you trying to copy a file from a network share?
August 25th, 2015 9:48am
To add to Garth comment. If you are using a installation behavior: Install for system SCCM will run this using system account and will have access to program files.
August 25th, 2015 9:51am
Concur with the others. Follow the simple direction at http://blog.configmgrftw.com/copying-files-to-clients-using-configgr/ to get this done.
August 25th, 2015 4:23pm
I'm copying a text file from a network share to a folder in Program Files X86.
If I run the script as an administrator from a network share it will install on my test VM. If I push it through SCCM it fails.
Any ideas?
Thanks
Chris
August 26th, 2015 4:07pm
when SCCM try to run it it will use the computer account to connect to that network share. Does the computer account have access to the file. You can test this using PSEXEC and run as system account from one of the pc.
-
Edited by
Frederick Dicaire
11 hours 12 minutes ago
August 26th, 2015 4:37pm
when SCCM try to run it it will use the computer account to connect to that network share.
... and will use the network access account if that fails.
August 26th, 2015 4:42pm
Oh thanks Torsten did not knew that. SI it only for package or application will do the same ?
August 26th, 2015 5:42pm
when SCCM try to run it it will use the computer account to connect to that network share. Does the computer account have access to the file. You can test this using PSEXEC and run as system account from one of the pc.
-
Edited by
Frederick Dicaire
Wednesday, August 26, 2015 8:36 PM
-
Proposed as answer by
Afraskai
15 hours 54 minutes ago
August 26th, 2015 8:36pm
Applications have to be distributed to a DP (no option to run from UNC available) so this is not applicable here.
August 27th, 2015 1:54am
I was under the impression he made a bat file that does copy \\location\file.txt "C:\Program Files (x86)\file.txt" and not running it from a UNC path.
August 27th, 2015 7:12am