wntAddDrive & save credentials

Started by domvalle@comcast.net, November 05, 2019, 12:22:34 PM

Previous topic - Next topic

domvalle@comcast.net

When using wntAddDrive and persist: @TRUE, the password is not remembered after a logoff.
Is there any way to force this?
We are using Win 10 Pro and Winbatch 2019B.
thanks!

td

Assuming you are referring to the credentials used to access the share you have mapped to a drive, you need to save the credentials in Windows 10's Credential Manager.  You can do this manually via an applet UI.  See the following for an easy way to access the applet on Windows 10.

https://support.microsoft.com/en-ca/help/4026814/windows-accessing-credential-manager

I know you can access the credential manager's cache of user names and passwords using dotNet or WMI.  However, I don't remember if you can add credentials.  I look into it and report back if I find something.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

There is always the cmdkey.exe utility that allows you to add or remove credentials from the Windows "vault".  Type "cmdkey.exe /?" from a command prompt to see usage.

There is a Powershell module for the credential manager around someplace but I am not sure that it is still supported.  I image it was just a cover for the Win32 Credential Manager API.  -  The API might make a good WIL extender.

Still think there might be a scripting solution but can't seem to come up with one at the moment.  Maybe some else has an idea.

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

domvalle@comcast.net

Actually  cmdkey.exe worked great!
used with the doscapture extender, nice!
thanks!

td

Some users prefer not to spin up a child process by running a command shell application but if that is not an issue for you,  you have your solution.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

There are several ways to capture a command shell window's output without using an extender documented in the Tech Database.  Here is a link to one of them

https://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/DOS+Capture~DOS~Window~output.txt
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade