Jump to content


dawitz

Batch file package push

Recommended Posts

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

 

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

  • Like 1

Share this post


Link to post
Share on other sites

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

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.