Jump to content


  • 0
rotem

Deploy a Batch File

Question

hey guys, i got a little issue

i am trying to run a btach file using software dist' that batch file is actually trying to kill certain service , delete an exe file , copy from server share another exe file and at the end i use NET START to start the new exe file as service ...

 

the prblem is that everything is working fine untill that phaze that the btach should run at the users workstation...

 

i get this :

post-9024-0-87772500-1308650836_thumb.jpg

 

i heard that i cant use .bat in software deploy instead in need to use .cmd is that correct?

or that i cant use copy command in the batch file from \\servershare\

anyway this is the batch file:

-------------------------------------------------------------------------------

 

taskkill /F /IM EXAMPLE.exe

DEL c:\windows\system32\EXAMPLE.exe

copy \\servershare\\dist\EXAMPLE.exe c:\windows\system32\

net start EXAMPLE

echo finish %computername% %date% %time% >> \\servershare\\dist\install.log

 

--------------------------------------------------------------------------------

am i doing something wrong?

please help

 

thanks!

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

You're using a UNC path to copy from, so are you running this with user rights? Otherwise it's only running as the local SYSTEM account, which wouldn't have rights to your network location. And if you ARE running it with user rights, then they'd have to have permissions such that they could kill the running process and delete the file...

Share this post


Link to post
Share on other sites

  • 0

You're going to probably have better luck making the script and associated files into an SCCM Package and then deploying that just like you would say... Adobe Reader, or something. On the package's Program, under the Environment tab, set it to "Run with administrative rights". Or if you want to try using a task sequence, you might take a look at this: http://www.windows-noob.com/forums/index.php?/topic/2758-how-can-i-copy-files-from-a-package

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
Answer this question...

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