Troubleshooting
Problem
Run command lspasswd.exe failed inside an user program on Windows with error "Can't get console mode "
Symptom
Run lspasswd.exe in a wrapper program failed with error "Can't get console mode ".
Run command lspasswd.exe directly in cmd.exe, it works without above error.
Cause
The error message, "Can't get console mode", indicate the Windows API GetConsoleMode() failed.
By design, command lspasswd.exe must be run in console mode.
If lspasswd.exe runs inside a program without a console, it will fail with above error message.
Resolving The Problem
For conception of console mode, refer the following page.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms683167%28v=vs.85%29.aspx
Then, check your wrapper program and make sure lspasswd.exe run with a console.
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
isg3T1026044