Solved

How to write a batch to register DLLs

Posted on 2007-04-04
1
460 Views
Last Modified: 2010-03-05
I need to write the following logic into batch file that would be run when user logs on
If PathExists("C:\MyApplication") then
  net use I: "Data_SERV\Data"
  regsvr32 -s "I:\MIS\Source Codes\DLL\clsLend.dll"
  regsvr32 -s "I:\MIS\Source Codes\DLL\clsLendSrv.dll"
end if

The inside of if statement is already correct just the folder exists check and if statement syntax I dont know.

0
Comment
Question by:psokolo
[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
1 Comment
 
LVL 30

Accepted Solution

by:
SteveGTR earned 500 total points
ID: 18853472
Try this:

@echo off

setlocal

if exist "C:\MyApplication" (
  net use I: "Data_SERV\Data"
  regsvr32 -s "I:\MIS\Source Codes\DLL\clsLend.dll"
  regsvr32 -s "I:\MIS\Source Codes\DLL\clsLendSrv.dll"
)

For more information on the if command and other commands, enter if /? at the command prompt.

Good Luck,
Steve
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

738 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