Solved

How to write a batch to register DLLs

Posted on 2007-04-04
1
455 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

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…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

770 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