Solved

Batch file to add/register 7 .dlls?

Posted on 2003-10-22
5
1,157 Views
Last Modified: 2008-03-20
Hello all,

I have two workstations that are slightly out of sync.  One is the reference standard, and the other is completely lacking 4 .dlls, and has older versions of 3 others.

I'd like to bundle all  7 .dlls along with (I think a batch file can do this) a .bat file that when double-clicked, will put all the .dlls into the System32 folder (including overwriting the three .dlls which are already present but are older), and regsvr32 them.

Then I can just bring this bundle over to the other system, double-click on the .bat file, and  all will be done.

I've never written a .bat file, so I have no idea how such a thing is created, or if it can even do what I want.

Thanks for any help

E
0
Comment
Question by:edmund_mitchell
  • 3
  • 2
5 Comments
 
LVL 1

Expert Comment

by:birdski
Comment Utility
rem   *unregisters old dlls*
regsvr32 /u oldfile1
regsvr32 /u oldfile2   ;repeat as needed

copy source destination /y

rem *registers silently*
regsvr32 /s newfile1  
regsvr32 /s newfile2   ;repeat as needed
0
 
LVL 4

Author Comment

by:edmund_mitchell
Comment Utility
birdski,

Thanks -- it looks good.  One thing I don't understand before I go forward and give you the points --

"copy source destination /y"

is a little puzzling.  If the batchfile is in the same dir as newfile1, newfile2, newfile3... etc, and I want all the .dlls to go to the winnt\system32 dir, then would I type

copy newfile1 newfile2 newfile3 newfile4 C:\winnt\system32 /y

or is there a delimited between the files, or to I have to be more complete with the path, or?

Thanks

E
0
 
LVL 1

Accepted Solution

by:
birdski earned 250 total points
Comment Utility
If you run the batch from the source folder, it should work like this.  You have a couple of options.

If there are other files in the source dir you don't want to copy, copy them individually:
copy x:\file1 c:\winnt\system32 /y          ;/y suppresses overwrite warning

If  you want all .dll's use wildcards:
copy x:\*.dll c:\winnt\system32 /y          ;/y suppresses overwrite warning

If  you want all use:
copy x:\*.* c:\winnt\system32 /y          ;/y suppresses overwrite warning

A complete path for both source and destination will always work better than hoping windows knows what dir you're currently in.  If your paths include long file or foldernames,  put the path in quotes.
"c:\program files\application" or ":x:\update files\app1"
0
 
LVL 4

Author Comment

by:edmund_mitchell
Comment Utility
Oh yeah -- you don't have to answer this; the points are yours and you did a great job, but if you are so inclined, I'd love to learn more about the things I can do inside a batch file and the syntax to make them happen.

Do you have any links?

Thanks again

0
 
LVL 1

Expert Comment

by:birdski
Comment Utility
 My suggestion would be to google it,  you'll get thousands of results and many might even be helpful.  There's a lot up there.    I'm just fortunate enough to have started computing back in the DOS 5.0 days.  One helpful hint is to get used to doing the "command" /? alot from a prompt and test sections of your batch individually or put pause commands inside so you can see the results before it goes on to the next step.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifi…
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now