Skip to content

Copy Files During Application Install

Featured Replies

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\"

post-24873-0-63987500-1452690471.jpg

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\"

  • Author

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

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...

  • Author

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$

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...

Is there a specific reason not to put the files into your package sources?

I didn't think you can use UNC paths in a batch file without using other commands like pushd etc

  • Author

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"

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.