Skip to content

Batch file package push

Featured Replies

I have a simple batch file to copy office templates from our share to user C drives. Here is the script\

 

@echo off

robocopy \\****\****\DataDeployment\OfficeTemplates\ "C:\Program Files (x86)\Microsoft Office\****" *.potx *.dotx /r:1 /w:1

 

The ***** are just me taking out relelvant company shares or name etc. However, on 4 or 5 machines the script will work and on about 20 others it fails. The folder exists in both cases. However, even if it didn't robocopy would create it. They error is 10006 16

 

 

I don't know what that error number is but if you are using the machinename for the server UNC link and you have a DNS issue at all it could be faulting from some machines not having good DNS going to them. Try navigating to the source location UNC path on one of the failing ones to see if you can get to the files/folders.

 

If that works then try manually running the command on that machine and see if it works manually even.

  • Author

Garret,

 

I tried that, I can navigate to the share ok on all systems. The interesting thing is that if I run the batch file on my system it works fine locally. if I go to another users machine who is having the issue via sccm and run the same batch file it fails.

Ok so on the machines with the issue you can't even manually run the file?

 

You can however manually connect to the location via the UNC path from the problem machine?

  • 4 weeks later...

I am trying to deploy a integrated application through batch file, i can able to run the batch file without any problem, all the application i intended to

install through the batch file it gets successively, but the thing here is all the time when the user startup the pc, it install every time,

i want to include IF statement in the same script, as to rectify "If the file exist, it should exit" or else it should install the application..

I am doing this through GPO Startup option, i unable to complete the "IF cmd" here, could u please advise n help me what mistake am doing here in writing this batch file....

 

echo

md c:\progra~1\planning

echo y| cacls c:\progra~1\planning /G Everyone:f

net use \\192.168.1.15 123 /user:administrator

set File = c:\progra~1\planning\eureka.bat

cd If not exist %File% Goto work

cd If exist %File% Goto TheEnd

:work

copy \\192.168.1.15\erp\eureka\eureka.bat c:\progra~1\planning\eureka.bat /y
copy \\192.168.1.15\erp\SSubTmr6.dll c:\progra~1\planning\SSubTmr6.dll /y
copy \\192.168.1.15\erp\eureka\FSPL-EUREKA-SETUP.bat c:\progra~1\planning\EUREKA-SETUP.bat /y
copy \\192.168.1.15\erp\vbalExpBar6.ocx c:\progra~1\planning\vbalExpBar6.ocx /y
copy \\192.168.1.15\erp\vbalIml6.ocx c:\progra~1\planning\vbalIml6.ocx /y
copy \\192.168.1.15\erp\regsvr32.bat c:\progra~1\planning\regsvr32.bat /y
copy \\192.168.1.15\erp\sys.bat c:\progra~1\planning\sys.bat /y

@echo on
cd C:\progra~1\planning
start EUREKA-SETUP.bat & eureka.bat
@pause
cmd /k

:TheEnd
Exit

Note : without this "IF cmd" the same script work quite fine, but all here i want to run this file only once during startup, if the desired application is not exist in your system...If the same exist, the script should get exit without copying and gettng installed in user pc....

Ok, I have to ask, why are you not include these files within the package and running the batch file locally, instead of mapping a drive? Why are you making your life difficult by using mapped drives/UNCs?

If these clients have SCCM you could also just setup compliance for the applications and it will check against the compliance rules and either install it if they don't have it or just leave it alone if they do have it.

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.