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?
LVL 13
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
You can unregister it in code by shelling regsvr32 like so - Shell "regsvr32.exe MyDLL.dll" & Space(1) & "/u  /s"
dunglaAuthor Commented:

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

Thank for your solution
Oops! Guess I read the question too quickly. Hope the other solution works!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.