[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

How to unregister dll automatically when reached a specifi date/time?

Hi all,

I've developed a dll by programming with VB6 named "MyDLL.dll" and also register to system by calling "regsvr32 D:\mydll.dll". I just want to know how can i unregister it in programming VB. Here is the scenario:

After 4 days since register the dll, i want to dll will unregister itself from system? How can i do that?
0
dungla
Asked:
dungla
1 Solution
 
Marv-inCommented:
you cant have your dll unregister automatically - but you can have it check the datediff of when it was installed and when its being accessed.

you can store the install date in the registry to check on access or in a text file.
0
 
JohnBPriceCommented:
You can also just schedule the unregister, figure out the day of week that is 4 days from now and in a DOS script do...

at 12:01 /next:Thursday "regsvr32 -u D:\mydll.dll"

or figure out the  day of month and do...

at 12:01 /next:17 "regsvr32 -u D:\mydll.dll"

On windows 2000 and later, these will run in the system account.
0
 
LizelleFanCommented:
You can unregister it in code by shelling regsvr32 like so - Shell "regsvr32.exe MyDLL.dll" & Space(1) & "/u  /s"
0
 
dunglaAuthor Commented:
LizelleFan,

I have only one file, is the DLL file, how can I make it run the shell code automatically?

JohnBPrice:
Thank for your solution
0
 
LizelleFanCommented:
Oops! Guess I read the question too quickly. Hope the other solution works!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now