Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing drive letters w/o rebooting

Status
Not open for further replies.
Nov 30, 2004
3
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top