Web Development

General discussion


Visual Basic & Windows 2000 PRO

By paulfr2 ·
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?


Paul Friedrichsmeyer

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

Visual Basic & Windows 2000 PRO

by agibbs In reply to Visual Basic & Windows 20 ...

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")


Collapse -

Visual Basic & Windows 2000 PRO

by paulfr2 In reply to Visual Basic & Windows 20 ...

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.


Collapse -

Visual Basic & Windows 2000 PRO

by paulfr2 In reply to Visual Basic & Windows 20 ...

This question was closed by the author

Related Discussions

Related Forums