Discussion:
How to use Shell32.dll?
(too old to reply)
b***@gmail.com
2017-06-30 11:16:21 UTC
Permalink
I would like to call the SHChangeNotify function from Shell32.dll, but I couldn't find any source about it on the internet.

I would like to use it to send an SHCNE_DRIVEADD system message, so a special program could be tested easier.
I use a batch file to create or format a virtual pendrive, then I copy the necessary files on it. That's when I would like to make that program recheck the drives.

Could you help me out, if it can be done or not? And if yes, then how?
Mayayana
2017-06-30 12:28:59 UTC
Permalink
<***@gmail.com> wrote

|I would like to call the SHChangeNotify function from Shell32.dll, but I
couldn't find any source about it on the internet.
|

You can't do anything like that directly from script.
You'd have to write something like a COM library that
VBS can use.

It might be possible to cause an update
by opening the "Computer" folder:

Dim ShAp
Set ShAp = CreateObject("Shell.Application")
ShAp.open 17
Set ShAp = Nothing
b***@gmail.com
2017-07-04 15:24:39 UTC
Permalink
Sadly it is very specific to trick that program. It needs that windows message, containing which drive has been removed/added. And the program would be useful only if it is a 1 file portable program to any other computer.
Probably I'll have to write a c++ program for it that uses cmd commands where it's necessary.
Thx for your help!

Loading...