Jump to content


Irfansj

Creating a Simple Package using batch file

Recommended Posts

Hello,

I have struggling hard to create a simple package using a batch file. Probably if some one can help

 

I need to copy DLL file to c:\windows\system32 directory on all managed clients. Also

I need to run .reg file on all client workstations which will create keys in the registry.

 

Action I took:

I created a batch file using

copy \\ServerName\.... c:\windows\system32

regedit /S \\Servername\path\register.reg

 

I than go up and create a standard program from the Package --> New Package wizard.

 

However i am unable to copy these files to system32 directory.

 

Is there a different way to create such packages??

Where should i search for error logs on client side ??

Share this post


Link to post
Share on other sites

Have a package with your files in it and a batch file also:

The syntax so it deploys from the DP

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

@Ehco

copy %~dp0filename1.extension "c:\windows\system32"

copy %~dp0filename2.extension "c:\windows\system32"

copy %~dp0filename3.extension "c:\windows\system32"

copy %~dp0filename4.extension "c:\windows\system32"

copy %~dp0filename5.extension "c:\windows\system32"

regedit.exe /s regkeys.reg

@Exit

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

 

your rekeys.reg would have to be taken from a machine with the app installed!! Put all the keys into one AKA regkeys.reg

 

Rocket Man

Share this post


Link to post
Share on other sites

Hello Rocket Man,

Not sure, if i have understood correctly, requesting to confirm steps below.

 

Step1.

I created a batch file : DLL.bat (with exactly the same contents as below)

@Ehco

copy %~dp0passwordreset.dll "c:\windows\system32"

copy %~dp0msvcrt100.dll "c:\windows\system32"

regedit.exe /s regkeys.reg

@Exit

 

My doubt in step1.

Doubt1

should i use the commandline regedit.exe /s regkeys.reg in the batch file OR I need to replace with my actual registry files as below

regedit.exe /s unregister.reg

regedit.exe /s unregister.reg

Doubt2

should i use the inverted commas as "c:\windows\system32" OR

c:\windows\system32

 

 

Step2:

I copied this batch file, passwordreset.dll, msvcrt100.dll , unregister.reg and register.reg inside \\sccmsrv\software\dll folder. The software folder is shared for everyone

 

Step3:

I create a package using below steps

Package --> create package --> The package contains source files (pointed to the \\sccmsrv\software\dll\ ) folder. Selected "Do not create a Program". This only created a package.

 

Step4

I then distributed it to DP's via "Distribute Content"

 

Step5

I than apply to collections.

 

 

Regards

Irfan

Share this post


Link to post
Share on other sites

The registry should execute if you have all the registry enteries in the one registry key called regedit.reg, if all keys are specified in this and where to add to the registery it should work!!

 

Works well for me on a specific piece of software!!

 

As for your other problem .....well atleast the files are now copying to the local machine, unfortunately I can give you no more assistance on this area as I only run x86 clients so have no idea as to why they are copying to the sysWOW64 folder??

 

Maybe some one else knows and would like to contribute?

 

Rocket Man

Share this post


Link to post
Share on other sites

Thanks RocketMan,

Yes you are absolutely right. The registry also got executed but it got executed in HKLM--> software --> WOW6432 node --> Microsoft --> windows --> ..... instead of HKLM --> software --> Microsoft.

 

Thanks for your help. If i am able to resolve this , i will definately update you..

 

Thanks once again for your great support.

 

Regards

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