regan Posted January 13, 2016 Report post Posted January 13, 2016 I have created an application which contains multiple installs which all work well however I have added a bat file at the end which copies a couple of INI files to a directory. The bat file seems to work fine but during the install it doesn’t. I may be going about it the wrong way so any advice would be welcome. The bat file is del "C:\WINDOWS\sims.ini" if not exist "c:\program files\sims\sims .net\connect.ini" copy /y "\\MySccmserver\Sources\OS Deployment Share\Shortcuts\Sims Connect ini\connect.ini" "c:\program file\sims\sims .net" if not exist "C:\WINDOWS\sims.ini" copy /y "\\ MySccmserver \Sources\OS Deployment Share\Shortcuts\Sims Ini\sims.ini" "C:\WINDOWS\" Quote Share this post Link to post Share on other sites More sharing options...
jorlando Posted January 13, 2016 Report post Posted January 13, 2016 Assuming the programs run under system context? User will not have permission to C;\windows. Does \\mysccmserver file share give every machine account permission to the files? You could just put a copy of connect.ini & sims.ini in the application content source. Then you would just need to change the bat file to (this way the ini files will just be in the working directory) : del "C:\WINDOWS\sims.ini" if not exist "c:\program files\sims\sims .net\connect.ini" copy /y "connect.ini" "c:\program files (x86)\sims\" if not exist "C:\WINDOWS\sims.ini" copy /y "sims.ini" "C:\WINDOWS\" Quote Share this post Link to post Share on other sites More sharing options...
regan Posted January 14, 2016 Report post Posted January 14, 2016 I think the issues is access to the C:\WINDOWS folder as i have to run as administrator in order to work. During a TS i can just create a package and use xcopy which works but im trying to build it into the application Quote Share this post Link to post Share on other sites More sharing options...
ZeZe Posted January 14, 2016 Report post Posted January 14, 2016 Which account is he using to login into the servers?... what I mean was.. aren't the applications run by the SYSTEM account? so... Can the SYSTEM account copy content to your server? hmm... Quote Share this post Link to post Share on other sites More sharing options...
regan Posted January 15, 2016 Report post Posted January 15, 2016 ive added below to the top and it works is u run as administrator but without it i dont have permission to c:\program files NET USE \\MySccmserver\e$ Quote Share this post Link to post Share on other sites More sharing options...
ZeZe Posted January 15, 2016 Report post Posted January 15, 2016 Well... I guess the user SYSTEM account doesn't have permissions to browse your server. That's why you should use an account that has the proper permissions to copy file into that network location... Quote Share this post Link to post Share on other sites More sharing options...
Peter33 Posted January 15, 2016 Report post Posted January 15, 2016 Is there a specific reason not to put the files into your package sources? Quote Share this post Link to post Share on other sites More sharing options...
ZeZe Posted January 15, 2016 Report post Posted January 15, 2016 Or that... haha Quote Share this post Link to post Share on other sites More sharing options...
g-fx Posted January 17, 2016 Report post Posted January 17, 2016 I didn't think you can use UNC paths in a batch file without using other commands like pushd etc Quote Share this post Link to post Share on other sites More sharing options...
regan Posted January 18, 2016 Report post Posted January 18, 2016 Is there a specific reason not to put the files into your package sources? No there's not, i can do that, how would i reference that in the bat file though? if not exist "C:\Program Files\SIMS\SIMS.Net\connect.ini" copy /y "\\%~dp\Sims Connect ini" "C:\Program Files\SIMS\SIMS.Net" Quote Share this post Link to post Share on other sites More sharing options...