Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Batch file to add/register 7 .dlls?

Posted on 2003-10-22
5
Medium Priority
?
1,185 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
ID: 9601033
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
ID: 9601356
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 1000 total points
ID: 9601416
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
ID: 9601704
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
ID: 9601871
 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Steps to fix error: “Couldn’t mount the database that you specified. Specified database: HU-DB; Error code: An Active Manager operation fail”
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

885 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