Discussion Locked

Visual Basic & Windows 2000 PRO

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Ok here's my question... I'm trying to create a simple form with a listview box that has a few selections in it for simple administrative commands for the end users at my company. The problem I am having is trying to bring up the Windows Users And Password Control panel in Windows 2000 using Visual Basic 6.0SP4... The line of code that I have used is:

Private Sub autosizelabel_DblClick()
Dim dblReturn As Double

If autosizelabel.SelectedItem = "Change Your Windows Password" Then
dblReturn = Shell("rundll32.exe shell32.dll,Control_RunDLL password.cpl", 5)

End If

End Sub

When Double-Clicked the command does not execute, not even an vb runtime error message is displayed. I have looked through the Registry for anything .cpl and have come to a dead end. Any suggestions?

Thanks,

Paul Friedrichsmeyer
paulfr2@home.com

3 replies

by agibbs

I'm not sure exactly what you mean by the "windows users & passwords" control panel. Windows98 uses a "passwords" control panel -- Win2K does not. You have to use the Computer Management tool under Administrative Tools to add/remove users and change passwords. To fire up the Computer Management applet (using the MMC), use:

Shell ("%SYSTEMROOT%\system32\compmgmt.msc /s")

--Aaron

by paulfr2

That would be great if it worked. Under a Dos shell it does work, but not as this statement in VB it doesnt:

If autosizelable.SelectedItem = "Password Change" Then

Shell ("C:\winnt\system32\compmgmt.msc /s")
End If

I tried variations of that procedure and all I get is a error message in VB stating:

Runtime Error "5":

Invalid Procedure call or argument

Thanks for the insight though.

Paul

This discussion is closed to new replies.