Solved

Batch file to add/register 7 .dlls?

Posted on 2003-10-22
5
1,169 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 250 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Print Server: How to Create it? 1 774
Remote Access to a Windows 2000 Computer 2 512
VMware converter for windows 2000 server SP4 4 6,204
Windows Foriegn Disk 3 140
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…
This article summaries thoughts and ideas from two years of sustained use. It provides good reasoning to make the jump to Windows 10.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

680 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