greggardner
MIS
The end project of this question is actually a VBscript program using DynaWrap but the folks over there suggested this forum as hopefully best able to solve my problem.
I need to change some drive letters from a script without rebooting (ala the Disk Management applet). My environment is Windows XP.
No problem modifying the MountedDevices registry values but my changes don't take effect until after rebooting. It was suggested that I use DynaWrap to "call" user32.dll with the params (&HFFFF, &H1A, 0, 0). The first two correspond to HWND_BROADCAST & WM_SETTINGCHANGE.
The VBscript lines (using DynaWrap) are:
Set oDWrap = CreateObject("DynamicWrapper")
oDWrap.Register "user32.dll", "SendMessageA", "i=llll", "f=s", "r=l"
oDWrap.SendMessageA &HFFFF, &H1A, 0, 0
The above runs but doesn't seem to have any effect.
1) Is this the correct Win32 API call to broadcast a drive letter change? If not, can someone point me at what would work?
2) Is the above method appropriate (given the age of DynaWrap) or is there now a better way to approach this that would work with VBscript?
Thanks for any help,
Greg Gardner
I need to change some drive letters from a script without rebooting (ala the Disk Management applet). My environment is Windows XP.
No problem modifying the MountedDevices registry values but my changes don't take effect until after rebooting. It was suggested that I use DynaWrap to "call" user32.dll with the params (&HFFFF, &H1A, 0, 0). The first two correspond to HWND_BROADCAST & WM_SETTINGCHANGE.
The VBscript lines (using DynaWrap) are:
Set oDWrap = CreateObject("DynamicWrapper")
oDWrap.Register "user32.dll", "SendMessageA", "i=llll", "f=s", "r=l"
oDWrap.SendMessageA &HFFFF, &H1A, 0, 0
The above runs but doesn't seem to have any effect.
1) Is this the correct Win32 API call to broadcast a drive letter change? If not, can someone point me at what would work?
2) Is the above method appropriate (given the age of DynaWrap) or is there now a better way to approach this that would work with VBscript?
Thanks for any help,
Greg Gardner