Solved

Batch file to add/register 7 .dlls?

Posted on 2003-10-22
5
1,177 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

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…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

624 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